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.
Magic Model Analyst 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.
Related pages