Reserved Words and Expressions : Expressions : Trigger Expressions : Event Expressions : The ELSE Trigger

The ELSE Trigger

You can use ELSE as a predefined trigger event in triggers of transitions, reactive mini-specs, and state-static reactions.

Note:  
You cannot use ELSE as a guard on a default transition.
When ELSE is used in a mini-spec or static reaction, the ELSE 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.
An ELSE trigger cannot be part of an expression. It must appear alone. For example, the following statement is illegal:

else or e1

Using two ELSE triggers exiting from the same source state is illegal and is reported as an error by Check Model.
DEFAULT is an alias of ELSE.

Example:

Consider the following statement:

event1/action1;;else/action2;
 
 

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.