A combined fragment groups together interaction fragments, i.e. messages and other combined fragments. Its interaction operator defines the semantics of a combined fragment. The table below lists the supported interaction operators and their meaning.
A combined fragment also has one or more interaction operands that provide further grouping of interaction fragments. The meaning of the interaction operands depends on the interaction operator. For example, with an Alt operator the interaction operands are alternative, mutually exclusive execution paths. With a Par operator, the interaction operands would typically execute in parallel. Each interaction operand has a boolean condition called interaction constraint enclosed in brackets. The interaction operand is executed when or while the condition is true.
The third column in the table gives the Java control structure(s) the cause the generation from source code of a combined fragment with that particular interaction operator. This happens when you select the context menu Add Called Operations on a message.
Operator | Description | Java |
---|---|---|
Alt | The interaction operator alt means that the combined fragment represents a choice or alternatives of behavior. At most one of the operands will be chosen. The chosen operand must have an explicit or implicit guard expression that evaluates to true at this point in the interaction. An implicit true guard is implied if the operand has no guard. | if … else , switch , ?: |
Assert | The interactionOperator assert designates that the combined fragment represents an assertion. The sequences of the operand of the assertion are the only valid continuations. All other continuations result in an invalid trace. Assertions are often combined with Ignore or Consider. | |
Break | The interaction operator break designates that the combined fragment represents a breaking scenario in the sense that the operand is a scenario that is performed instead of the remainder of the enclosing InteractionFragment. A break operator with a guard is chosen when the guard is true and the rest of the enclosing Interaction Fragment is ignored. When the guard of the break operand is false, the break operand is ignored and the rest of the enclosing interaction fragment is chosen. | break , throw |
Consider | The interaction operator consider defines which messages should be considered within this combined fragment, meaning that any other message will be ignored. | |
Critical | The interaction operator critical defines that the combined fragment represents a critical region. A critical region is a region with traces that cannot be interleaved by other occurrence specifications (on the lifelines covered by the region). This means that the region is treated atomically by the enclosing fragment and can't be interleaved, e.g. by parallel operator. | synchronized |
Ignore | The interaction operator ignore designates that there are some message types that are not shown within this combined fragment. These message types can be considered insignificant and are implicitly ignored if they appear in a corresponding execution. Alternatively, one can understand ignore to mean that the message types that are ignored can appear anywhere in the traces. | |
Loop | The interaction operator loop designates that the combined fragment represents a loop. The loop operand will be repeated a number of times. | for , while , do … while |
Neg | The interaction operator neg designates that the combined fragment represents traces that are defined to be invalid. |
|
Opt | The interaction operator opt designates that the combined fragment represents a choice of behavior where either the (sole) operand happens or nothing happens. An option is semantically equivalent to an alternative combined fragment where there is one operand with non-empty content and the second operand is empty. | if |
Par | The interaction operator par defines potentially parallel execution of behaviors of the operands of the combined fragment. Different operands can be interleaved in any way as long as the ordering imposed by each operand is preserved. | |
Seq | The interaction operator seq designates that the combined fragment represents a weak sequencing between the behaviors of the operands. | |
Strict | The interaction operator strict designates that the combined fragment represents a strict sequencing between the behaviors of the operands. The semantics of strict sequencing defines a strict ordering of the operands on the first level within the combined fragment with interaction operator strict. |