Defining Interaction Participants
Interaction partners are modeled using lifelines, which display messages that have been sent and received in chronological order.
Prerequisites
In order to be able to create a sequence diagram, you need to specify the Behaviored Classifier for which the communication is to be described. Behaviored classifiers include class, component and use case, among others.
Context
In order to usefully define the participants in an interaction, it must be possible to structure the Behaviored Classifier to which the interaction belongs using Connectable Elements. As actors and use cases are counted as Behaviored Classifiers but cannot be structured, in interactions with both these element types it is only possible to create lifelines that represent the actor or use case as a whole.
Communication partners involved in an interaction are represented in UML sequence diagrams by lifelines, which display messages that have been sent and received in chronological order.
How to proceed
-
Place the mouse pointer at the chosen position in the interaction frame and select the
Lifeline template from the mini toolbar in the context menu.
The Prerequisite dialog is opened and is initially empty as no interaction partner has been selected.
-
Click on Add....
The Add Requirement dialog opens; this includes the Behaviored Classifier for the interaction and its Connectable Elements, as already defined in your model.
-
Select the behaviored classifier for the interaction or one of its connectable elements, or use the Create New Element button to create a connectable element that does not exist yet. A wizard then takes you through the steps necessary for this.
-
Confirm your selection with OK.
The selected elements are inserted into the sequence diagram as lifelines next to each other and either labeled with the type of the selected connectable element or with the key word "
self
". In the latter case, the lifeline represents the behaviored classifier of the interaction as a whole. You can change the properties of a lifeline directly in theProperties tool window.