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
- Click the Interaction Occurrence button.
Alternatively, you can use the Add Interaction Occurrence option
in the menu.
- 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.
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.
- Right-click the interaction occurrence and
then select Features.
- 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.
- 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.