Previous | UML Classes | Table of Contents | UML Packages | Next |
•
NamedElement (from Kernel , Dependencies ) on page 99.
A lifeline represents an individual participant in the Interaction. While Parts and StructuralFeatures may have multiplicity
greater than 1, Lifeline s represent only one interacting entity.
Lifeline is a specialization of NamedElement .
If the referenced ConnectableElement is multivalued (i.e, has a multiplicity > 1), then the Lifeline may have an expression
(the ‘selector’) that specifies which particular part is represented by this Lifeline . If the selector is omitted, this means
that an arbitrary representative of the multivalued ConnectableElement is chosen.
Associations
Issue 8343 - replace ‘Expression’ with ‘ValueSpecification ’
• selector : ValueSpecification [0..1] If the referenced ConnectableElement is multivalued, then this specifies the specific individual part within that set.
• interaction: Interaction[1] References the Interaction enclosing this Lifeline .
• represents: ConnectableElement [0..1] References the ConnectableElement within the classifier that contains the enclosing interaction.
• decomposedAs : PartDecomposition [0..1] References the Interaction that represents the decomposition.
Issue 8976 - add ‘coveredBy’ entry
• coveredBy : InteractionFragment [0..1] References the InteractionFragments in which this Lifeline takes part
Constraints
[1] If two (or more) InteractionUse s within one Interaction, refer to Interactions with common Lifeline s, those Lifeline s
must also appear in the Interaction with the InteractionUse s. By ‘common Lifeline s’ we mean Lifeline s with the same selector
and represents associations.
[2] The selector for a Lifeline must only be specified if the referenced Part is multivalued.
(self.selector->isEmpty() implies not self.represents.isMultivalued()) or
(not self.selector->isEmpty() implies self.represents.isMultivalued())
[3] The classifier containing the referenced ConnectableElement must be the same classifier, or an ancestor, of the classifier
that contains the interaction enclosing this lifeline.
if (represents->notEmpty()) then (if selector->notEmpty() then represents.isMultivalued() else not represents.isMultivalued())
Semantics
The order of OccurrenceSpecifications along a Lifeline is significant denoting the order in which these OccurrenceSpecifications
will occur. The absolute distances between the OccurrenceSpecifications on the Lifeline are, however, irrelevant for the semantics.
The semantics of the Lifeline (within an Interaction) is the semantics of the Interaction selecting only OccurrenceSpecifications
of this Lifeline .
Notation
A Lifeline is shown using a symbol that consists of a rectangle forming its head followed by a vertical line (which may be
dashed) that represents the lifetime of the participant. Information identifying the lifeline is displayed inside the rectangle
in the following format:
<lifelineident> ::= ([<connectable-element-name>[‘[‘ <selector> ‘]’]] [: <class_name>] [decomposition]) | ‘self ’<selector> ::= <expression><decomposition> ::= ‘ref ’ <interactionident> [‘strict’]
where <class-name> is the type referenced by the represented ConnectableElement . Note that, although the syntax allows it,
<lifelineident> cannot be empty.
The Lifeline head has a shape that is based on the classifier for the part that this lifeline represents. Often the head is
a white rectangle containing the name.
If the name is the keyword self, then the lifeline represents the object of the classifier that encloses the Interaction that
owns the Lifeline . Ports of the encloser may be shown separately even when self is included.
To depict method activations we apply a thin grey or white rectangle that covers the Lifeline line.
Examples
See
Figure 14.16 where the Lifeline s are pointed to.
See
Figure 14.11 to see method activations.
Changes from previous UML
Lifeline s are basically the same concept as before in UML 1.x.