You can make it so that animated instance lines
on sequence diagrams are auto-created so that you can see the run-time
instance appear in the animated sequence diagram when they are created.
(Typically during an animation session, you have to drag the created
instance from the browser in IBM® Rational® Rhapsody® onto
the animated sequence diagram to see the operation of that instance
getting called.) However, with added notation to an instance line
name on a sequence diagram, you can have the product auto‑create the
animated instances when you run animation. This capability means that
you can mark a specific class to auto-create any sequence diagram
instances at run time on the animated sequence diagram.
Procedure
- Make sure that you have the active configuration
set for Animation. See Setting the instrumentation mode.
- Create a sequence diagram and make sure
that it is open (or open a current sequence diagram for which you
want to auto-create animated instances).
Note: You
can set the
SequenceDiagram::General::AutoLaunchAnimation property
to
Always to make the diagram open automatically
when animation starts.
- Depending on what you did in the previous
step:
- From the browser in Rational Rhapsody,
drag a class that you want to auto-create instances for on your sequence
diagram and add an asterisk (*) to the beginning of the name. For
example: *:Dishwasher. Or,
- On the diagram, change the name of an instance
by adding an asterisk (*) to the beginning of the
name. To do this, click the name to focus the pointer on it. Once
the name is highlighted, use your keyboard arrow keys or the mouse
to position your mouse pointer to the beginning of the name and add * to
it. For example: *:Dishwasher, as shown in the following
figure:
- On the Code toolbar, click the GMR
button
generate, make, and run your model.
- On the Animation toolbar, click the
Go button
to start the animation session.
- Notice that the product creates an animated
sequence diagram that has all auto-generated instances of type <class_name>,
as shown in the following figure:
Results
Note the following restrictions:
- There is no auto-creation of derived classes.
- This feature is unavailable for IBM Rational Rhapsody Developer for Ada.