Auto-creating animated instances

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

  1. Make sure that you have the active configuration set for Animation. See Setting the instrumentation mode.
  2. 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.
  3. 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:
      Sequence diagram - add * to beginning of class to auto-create animated instances
  4. On the Code toolbar, click the GMR button GMR button generate, make, and run your model.
  5. On the Animation toolbar, click the Go button Go button to start the animation session.
  6. 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:
    Example of animated sequence diagram that has auto-generated instances

Results

Note the following restrictions:


Feedback