Forum Discussion

Former_Member's avatar
Former_Member
Accelerator III
9 years ago

Major Rev refusing to increment

I had good behavior until just recently. I was operating on Manual versioning because of the inability to properly view prior revisions and generations with default behavior of only seeing the most recent revision. (We have prior revisions that are still active, despite being superseded.) In this scenario, I was able to manually create revisions properly. I modified the PE_CreateNewRevision function to check my current life cycle state to determine if a revision can be created. No problems... working fine. Then, yesterday I added the major rev to the Keyed name order for displaying in tabs and also set the sort order on that column (guessing this is non issue). I then switched my version control back to automatic so I could play with some custom queries and the generation feature. I now cannot get the major rev to increment using the same modified CreateNewRevision function. Throwing no errors. I'm not even sure where to start here given that this.apply("version") called in the method and appears to be getting called directly.

4 Replies

  • Hello, Could you please post the section of the PE_CreateNewRevision Method that you modified? I'd like to try to reproduce this behavior in a test environment. Chris _____________________________________ Christopher Gillis Aras Labs Software Engineer
  • I ran a test. Created a temporary lifecycle state with the name released and was able to increment the major revision number with the standard PE_CreateNewRevision method. Just want to make sure that its clear that this method was working until I made a modification of some sort. I think it was the change of the revision tracking from manual to automatic. Here is the change I made to the method. Pretty minimal.
    string[] ReleasedStates ={"In Design","Prototype","Active", "Inactive", "Obsolete", "Discontinued"}; string currentState = this.getProperty("state",""); //bool isInReleasedState = ReleasedStates.Contains(this.getProperty("state","")); //bool isInReleasedState = String.Equals(this.getProperty("state",""), "Active", StringComparison.Ordinal); bool isInReleasedState = false; if(ReleasedStates.Contains(currentState)){ isInReleasedState = true; }
  • Expanded my test on this a bit. I had created my own version of PE_CreateNewRevision . To test the behavior, I went back and modified PE_CreateNewRevision  by removing the check for revision status.
    // Item must be in the Released state //if (!isInReleasedState) //{ // return inn.newError(CCO.ErrorLookup.Lookup("PE_ManualRelease_MustBeInReleasedState", thisType)); //}
    I then used this method on my Model objects. When the model is in a state that PE_CreateNewRevision  sees a released life cycle state ("Released") it increments the Major Revision. If the model is in a life cycle state that PE_CreateNewRevision would see as a non released part (with the code above not commented out), it fails to increment the Major REeision. Its looking like the the items this.apply("version") has begun looking at the items "State" to determine if it should increment. Whats also off here is that its not looking at the item's lifecycle state "released" status. Each life cycle state has a "released" check box. current_state is shown as a referenced item type, specifically "Life Cycle State" item type. I wanted to know if the "released" property of the life cycle state item was available to be checked. I added a foreign property to my item, referencing the Life Cycle State item and using its "is_released" property. When viewing this property in a form, there is no update. When accessing my "life cycle state" items from a TOC view, the "is_released" property is correct.
  • Hi, You are currently hard-coding the Lifecycle states into the Method to check if they are released, you will have to modify the code to match the new state names of the released states. string[] ReleasedStates ={“In Design”,”Prototype”,”Active”, “Inactive”, “Obsolete”, “Discontinued”}; The second option would require more work, but you may be able to look at the Item property "status" and retrieve the released property that way.