On this page
A Combined fragment is a combination (expression) of Interaction fragments defined by an Interaction operator and corresponding Interaction operands. A Combined fragment may have Interaction constraints, also called guards.
Cameo Simulation Toolkit supports three major Interaction operators: Alternative (alt), Option (opt), and Loop (loop). Combined fragments with various Interaction operators will also be supported (e.g., alt inside loop, opt inside loop, loop inside alt, etc.).
Alternative (alt), Option (opt), and Loop (loop) are supported in Interaction fragments.
Alternative (alt)
The Interaction operator alt signifies that the combined fragment represents a choice of Behavior. Only one of the operands will be chosen. The chosen operand must have an explicit or implicit Guard expression evaluated as true at a particular point in the Interaction. An implicit ‘true’ Guard is applied if the operand has no Guard.
An operand guarded by else means a Guard that is the negation of the dis-junction of all other Guards. If none of the operands has a Guard evaluated true, none of the operands are executed, and the remainder of the enclosing Interaction fragment is executed.
Option (opt)
The Interaction operator opt signifies 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. An implicit ‘true’ Guard is applied if the operand has no Guard.
Loop (loop)
The Interaction operator loop signifies that the combined fragment represents a loop. The loop operand will be repeated a number of times. Only an Interaction constraint (not iteration bounds), a Boolean expression shown in square brackets that guards an operand in a combined fragment, is supported.
Note
Any Guard that is not Boolean expression evaluation will show a Question dialog box to set the evaluation result true or false. See also using Guards on Transitions.
Related pages