In sequence diagrams, an interaction operator defines the semantics
of a combined fragment and determines how to use the interaction operands
in the combined fragment.
The following table lists the most commonly used interaction operators:
| Interaction operator |
Description |
| Alternative (alt) |
An alternative interaction operator represents the logic equivalent
of an if-then-else statement. Only one of the offered alternatives runs on
any pass through the interaction. However, as for any operand, the selected
operand in the alternative structure runs only if the guard condition tests true.
If there is no guard, the operand always runs when it is selected. The else
clause of the alternative combined fragment runs when no other option is selected. |
| Option (opt) |
An option interaction operator represents the logic equivalent of
an if statement. To run,, the guard condition must be satisfied. If the guard
condition fails, the behavior is ignored. The graphic representation of an
option combined fragment looks like an alternative that offers only one alternative. |
| Loop |
A loop interaction operator indicates that the interaction fragment
runs repeatedly. The number of times the fragment runs is determined by the minint and maxint parameters
of the operator. The syntax of the loop operator is loop (minint, maxint)
where maxint can also be infinity (*). After the minimum
number of iterations is satisfied, a Boolean expression is tested on each
pass. When the Boolean expression tests false, the loop ends. |
| Parallel (par) |
A parallel interaction operation indicates that the interaction fragments
run concurrently with each other. |
| Critical Region (critical) |
A critical region operator indicates that the fragment can have only
one thread that runs it at any time. The fragment must complete before another
thread can run. For example, if an operation d() is within
the critical region and is invoked, no other operations can be invoked until
the completion of d(). |
| Negative (neg) |
A negative interaction operator shows invalid interactions that should
not be allowed to happen. |
| Break |
The break interaction operator is similar to the break mechanism
in other programming languages. When the guard condition is true ,
the current interaction run is abandoned and the clause in the break interaction
operand runs. |
| Strict sequencing (strict) |
The strict interaction operator explicitly defines the order of execution
of the interaction fragments. The strict operator forces the completion of
the interaction before running nested or additional interactions. |
| Weak sequencing (seq) |
The weak sequencing interaction operator adds order to the interactions
in the fragment based on their placement. The ordering is based on the UML
2.0 specification. Weak sequencing allows partial parallel execution, but
controls the order of events on the same lifeline from different interactions. |
| Ignore |
The ignore interaction operator indicates messages that the interaction
fragment should not respond to. The ignore operator is usually paired with
the consider operator. |
| Consider |
The consider interaction operator indicates messages that the interaction
fragment should respond to. The consider operator is usually paired with the
ignore operator. |
| Assert |
The assert interaction operator indicates that an interaction operand
is the next sequence in the interaction fragment. |