Question & Answer
Question
After importing an IBM® Rational® Rose model into IBM Rational Software Modeler or IBM Rational Software Architect, the sequence and communication diagrams may not display the label of the lifelines as it was shown in Rose. This technotes explains: 1. the reason why this may happen 2. how the modeling preferences can be set up to make sure that the display will be as it was in Rose 3. how the display can be changed programmatically if a model has already been imported.
Cause
In Rational Software Modeler or Rational Software Architect, the Modeling Preferences under Window > Preferences > Modeling > Diagrams > Sequence and Communication Diagrams is set to: Show Lifeline Represents Name only during the import of the Rose model:
Answer
Given a Rational Rose sequence diagram that looks as follows:
the same diagram may appear as shown below after the import into Rational Software Architect or Rational Software Modeler:
You can see that the two first lifelines do not show any label while the third one does. The reason is that the first two objects in Rose are unnamed, while the third one has a name.
To make sure that diagrams in Rational Software Modeler are shown as they were in Rose, you need to set the modeling preference under: Window > Preferences > Modeling > Diagrams > Sequence and Communication Diagrams to be Show Lifeline Represents Name and Type Name before the model is imported.
If you have already imported your Rose models, you can use the attached pluglet to change the display programmatically:
All source code and/or binaries attached to this document are referred to here as "the Program". IBM is not providing program services of any kind for the Program. IBM is providing the Program on an "AS IS" basis without warranty of any kind. IBM WILL NOT BE LIABLE FOR ANY ACTUAL, DIRECT, SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES OR FOR ANY ECONOMIC CONSEQUENTIAL DAMAGES (INCLUDING LOST PROFITS OR SAVINGS), EVEN IF IBM, OR ITS RESELLER, HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. |
---|
To use this pluglet, follow these instructions:
1. Import the attached zip file in your current workspace.
2. Create the pluglet configuration by:
- right clicking on the file
LifelineLabelCorrectorUI.java
, selecting Run As...
choosing Pluglet
4. The output of the pluglet will be written in the Console view. If the pluglet finds lifelines that are shown with only the Name of the Represents as shown below, it will modify the lifeline:
RoseSampleTest::Logical View::NewClass is not shown
--> LifeLine view changed to option: Represents Name and Type Name
RoseSampleTest::Logical View::NewClass2 is not shown
--> LifeLine view changed to option: Represents Name and Type Name
RoseSampleTest::Logical View::NewClass3 is not shown
--> LifeLine view changed to option: Represents Name and Type Name
Operation has modified:
Sequence diagram: NewDiagram
**Done***
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21329337