Creating an interaction occurrence

An interaction occurrence (or reference sequence diagram) enables you to refer to another sequence diagram from within a sequence diagram. This functionality enables you to break down complex scenarios into smaller scenarios that can be reused. Each scenario is an "interaction."

Procedure

  1. Click the Interaction Occurrence button.

    Alternatively, you can use the Add Interaction Occurrence option in the menu.
  2. Place the reference diagram on one or more instance lines to signify that those classes interact with the referenced sequence diagram. The interaction occurrence displays as a box with the "ref" label in the top corner, as shown in this example.
    Interaction occurrence

    By default, when you first create the interaction occurrence (and have not yet specified which diagram it refers to), the product names it using the convention interaction_n, where n is greater than or equal to 0.

  3. Right-click the interaction occurrence and then select Features.
  4. Use the Realization list to specify the sequence diagram being referenced. When you select the referenced diagram, the name of the interaction occurrence is updated automatically to reflect the name of the referenced sequence diagram.
  5. Click OK.

Results

You can move, rename, and delete reference sequence diagrams just like regular sequence diagrams. However, if you delete a sequence diagram that references an interaction occurrence, the interaction occurrence itself is not deleted, but becomes unassociated.

To change the default appearance of interaction occurrences, use the SequenceDiagram::InteractionOccurrence properties. See the definition displayed in the Properties tab for this property.


Feedback