The interaction in a UML sequence diagram defines some behavior. The lifelines within the interaction represent the individual participants in the interaction. You can add a new interaction and new lifelines to your sequence diagram, but you can also use existing elements from your UML model for creating interactions and lifelines.
This can be done by linking your newly created interaction or lifeline to an existing UML element from your model, or by directly dragging an existing element onto the sequence diagram.
Linking an interaction or lifeline to an existing UML element
In the diagram, click the interaction or lifeline, and then click the(interaction) or control (lifeline).
To select the lifeline element without its vertical dotted line, click the border of the element.
- In the selection window, select the desired element, and click OK.
Theand controls can also be used to change the linked element.
Once an element has been linked, you can navigate to the element by clicking thecontrol of the interaction or lifeline. Hovering this control on the interaction will show the name of the linked element. The name of the element linked to the lifeline is shown in the lifeline. Also, a lifeline with a linked element is colored yellow.
To remove the connection between an interaction or lifeline and its linked element, click thecontrol.
Controls of an interaction and lifeline with linked element
Creating an interaction or lifeline by dragging elements
The easiest way to create an interaction or lifeline using an existing UML element, is by directly dragging this element from the model browser onto the sequence diagram.
For an interaction, drag the element onto the diagram. For a lifeline, drag the element onto the interaction in the diagram. The dragged element will automatically turn into an interaction or lifeline element.
Dragging a use case actor onto an interaction