Question & Answer
Question
How do you generate new GUIDs for model elements in IBM Rational Rhapsody?
Cause
When you duplicate a Rhapsody model, or attempt to reuse elements from one Rhapsody model inside another, the GUIDs remain the same. The GUIDs are the unique identifiers for each element involved.
These actions might cause a clash in the following situations.
- You place both models inside the same Rhapsody Design Manager Project Area.
- You re-add the element that you copied and modified to the original model at a later date,
Answer
In two ways you can regenerate a GUID for a model element into a new and unique value.
Option 1
- Create a Package inside your existing model.
- Copy the elements that need new GUIDs into this package.
- Save the model.
If you must do this task for a small number of model elements.
In this way, you create copies within the same model that have unique GUIDs and are thus distinct from the originals. You can import these copies into other models through the Add To Model file menu option.
Option 2
Use the [Element].setGuid() method of the JavaAPI. If you provide an empty string as an argument, the element in question receives a new GUID. In this way, you update all existing references to that GUID within the model.
Product Synonym
Rational Rhapsody
Was this topic helpful?
Document Information
Modified date:
27 May 2022
UID
swg21979611