Using the swArchitect application, it is possible to change the current sequence of an existing Identity attribute.
One use case where this would be useful is when data has been migrated into the current database, and the next sequence number needs to continue at the last migrated or imported number. Another case would be when the sequence identifier attribute needs to be changed to another one. In this case, the new sequence should continue at the last value of the previous identifier attribute.
Prerequisites
- Meta Modelling - Important Notes and Recommendations
- Familiar with the SystemWeaver meta model building blocks (e.g., Items, Parts and Attributes)
- Assignment of the SW Architect role in the server
- An installation of the SystemWeaver Architect client (swArchitect)
Note: If the attribute is in use, the current sequence value may change while you are preparing the refactoring. If this may cause a problem (i.e., if there is a chance of overlap between the current sequence in use and the new sequence), it is best to complete the refactoring when there is little or no activity in the server. The tool does not check to prevent duplicate values. |
- To get started, log in to the server with the swArchitect client, and go to the Refactorings tab.
- Select Set sequence value in the left-hand menu.
- Enter the Sequence id of the attribute in the Sequence id field. If you do not know what this value is, you can view it in the attribute. Find the attribute in the Attributes list. Double-click on the attribute or right-click and select Edit. The Sequence id is displayed in the Edit Attribute type dialog.
- Enter this value in the Set sequence value refactoring tool. Once you enter it there, the Current sequence value field will populate automatically. It shows the "last-used" value. You can click Refresh at any time if you would like to confirm that this value has not changed during your preparation, i.e., a user has generated a new item having this attribute.
- Enter the New sequence value, e.g., 100. The New sequence value will be the new "last-used" value.
- Click Update. Given the below example of 100 as the new sequence value, the next time a user creates an item of a type that has an attribute with this sequence, the value assigned will be "101".