Completion Events are standard UML Events which are fired during the execution of a State Machine diagram. For composite or submachine States, a completion Event will be generated when all internal Activities, e.g., entry and doActivity Behaviors, have completed execution under either of the following circumstances
If the State is a composite State, all its orthogonal Regions have reached a FinalState.
if the State is a submachine State, the submachine StateMachine execution has reached a FinalState.
Tip
title
TIP
There is an option named You can enable/disable the Completion Events and Transitionsoption in the Simulation Environment options for enabling/disabling SCXML Engine group in the Project Options dialog for completion Events and Transitions support.
Image Removed
Image Added
The Completion Events and Transitions
Environment Options
option in the SCXML Engine group in the Project Options dialog.
Case 1
Completion Events and Transitions in a State Machine diagram.
For example, in the above State Machine diagram, a Transition from the "on" State to the "off" State does not happen until a completion Event is generated. The completion Event is generated after the DoActivity Behavior completes and only then the State transits from "on" to "off".
Case 2
Completion Events and Transitions in a State Machine diagram.
In the above State Machine diagram, a completion Event is generated after the entry and sendOff Behaviors have completed.
Case 3
Completion Events and Transitions in a State Machine diagram.
In the above State Machine diagram, a completion Event will be generated after the entry and working Behaviors have completed.
Info
title
Information
Completion Events have dispatch priority over all other Events. They are put into the beginning of the Event queue.