The ELSE Trigger
You can use
ELSE
as a predefined trigger event in triggers of transitions, reactive mini-specs, and state-static reactions.
● You cannot useELSE
as a guard on a default transition.
● WhenELSE
is used in a mini-spec or static reaction, theELSE
trigger is interpreted as an “else” of all the other triggers that exist, not just the ones that precede it in the mini-spec or static reaction.
● AnELSE
trigger cannot be part of an expression. It must appear alone. For example, the following statement is illegal:
● Using twoELSE
triggers exiting from the same source state is illegal and is reported as an error by Check Model.
●DEFAULT
is an alias ofELSE
.Consider the following statement:
When this statement is used in a static reaction,
action2
runs if none of the other triggers in the static reaction are activated and the system is in-state (that is, the state is neither in “entering” nor in “exiting”).When the statement used in a mini-spec,
action2
runs if none of the other triggers in the mini-spec are activated and the activity is in regular operation mode or has just been started.When the statement is used in a statechart, the
ELSE
trigger exiting from a state S1 is activated if none of the other triggers of the compound transitions exiting S1 are activated.