Final state

A final state denotes the end of the execution flow of a state machine or region. It can have multiple incoming transitions but no outgoing ones. Each region may contain at most one final state. In the case of orthogonal regions, the execution flow stops when all regions' final states have been reached.

As described in the completion transitions section, final states are heavily related to these kinds of transitions. The following example demonstrates the relation between final states and completion transitions.

Initial state of a statechart with orthogonal state and completion transitions

As the simulation of the statechart starts, the completion transitions are processed, so the final state located in region ‚r1’ gets activated.

State of a statechart with orthogonal state and completion transitions after raising 'proceed' event

After triggering the ‚proceed’ event the final state located in ‚r2’ gets activated, too. With that, all sub regions of the orthogonal state have been completed so the parent state can be considered as completed too. That results in traversing of the completion transition leading from state ‚Orthogonal State’ to ‚State C’.