IBM Support

How to clone elements with new GUIDs in Rhapsody

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


    If you must do this task for a small number of model elements.

    1. Create a Package inside your existing model.

    2. Copy the elements that need new GUIDs into this package.

    3. Save the model.

    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":{"code":"SSB2MU","label":"IBM Engineering Systems Design Rhapsody"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"General Information","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"8.0;8.0.1;8.0.2;8.0.3;8.0.4;8.0.5;8.0.6;8.1;8.1.1;8.1.2;8.1.2.1;8.1.3;8.1.4;8.1.5","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Product Synonym

Rational Rhapsody

Document Information

Modified date:
27 May 2022

UID

swg21979611