The swArchitect client provides a tool for changing the multiplicity of a part type from Single to List and vice versa. Existing data will not be affected. It will be possible to completed the data changes after the refactoring.
Setting up the Refactoring
- Log in to the swArchitect.
- Navigate to the Refactorings tab.
- Select Change Part Multiplicity in the left-hand menu.
- Use the browse button next to the Change Multiplicity of field to select the part type whose multiplicity you want to change. The Select Part Type dialog will display.
- Find and select the part type and click OK. The Change Multiplicity of field will populate with the SID of the part type followed by the Name of the part type and the from and to boxes will populate with either "List" and "Single" to indicate the multiplicity change that will be done. In the below example, the "ARPP : SendPort" part type is currently set-up for multiple occurrences and will be changed to only be allowed as a single occurrence.
- Once you are satisfied with you selection, click Execute.
Performing the Refactoring
From "List" to "Single"
If there are instances of multiple parts
When changing multiplicity from "List" to "Single", if there are instances of multiple parts, a list of the items with the multiple parts will be presented in the bottom section of the screen after you click Execute.
This list can be used as a reference when making changes to the data once the refactoring is completed.
Tip: You can select and copy the list of items from the GUI.
If you are sure you want to proceed with changing the multiplicity, click Continue to complete the refactoring. The next step will be to remove the excess parts for the list of items with multiple parts that was provided.
If there are no instances of multiple parts
If changing from "List" to "Single" and there are no instances of multiple parts, clicking Execute will present a Confirm dialog. To confirm and perform the refactoring, click OK.
If changing from "Single" to "List", clicking Execute will present the same Confirm dialog as shown above. To confirm and perform the refactoring, click OK.
Identifying If an Item Has Too Many Parts
When you have changed multiplicity from "List" to "Single", one way to identify if an item has too many parts is to use the Parts view. If there are more parts than are allowed, the part type will be highlighted in red. In the below example, the SUB part type had previously been set to "List", but is now "Single". However, there are two parts of part type SUB for the "A" item so one of them will need to be removed.