|On this page…|
The set of default flow paths execute (see Execute a Set of Flow Charts). If this action does not cause a state entry and the chart has parallel decomposition, then each parallel state becomes active (see Enter a State).
If executing the default flow paths does not cause state entry, a state inconsistency error occurs.
If the chart has no states, each execution is equivalent to initializing a chart. Otherwise, the active children execute. Parallel states execute in the same order that they become active.
Parallel (AND) states are ordered for entry based on whether you use explicit ordering (default) or implicit ordering. For details, see Explicit Ordering of Parallel States and Implicit Ordering of Parallel States.
If the state contains a history junction and there was an active child of this state at some point after the most recent chart initialization, perform the entry actions for that child. Otherwise, execute the default flow paths for the state.
If this state has children that are parallel states (parallel decomposition), perform entry steps 1 through 5 for each state according to its entry order.
If this state has only one child substate, the substate becomes active when the parent becomes active, regardless of whether a default transition is present. Entering the parent state automatically makes the substate active. The presence of any inner transition has no effect on determining the active substate.
The set of outer flow charts execute (see Execute a Set of Flow Charts). If this action causes a state transition, execution stops. (Note that this step never occurs for parallel states.)
The set of inner flow charts execute. If this action does not cause a state transition, the active children execute, starting at step 1. Parallel states execute in the same order that they become active.
Flow charts execute by starting at step 1 below with a set of starting transitions. The starting transitions for inner flow charts are all transition segments that originate on the respective state and reside entirely within that state. The starting transitions for outer flow charts are all transition segments that originate on the respective state but reside at least partially outside that state. The starting transitions for default flow charts are all default transition segments that have starting points with the same parent:
While there are remaining segments to test, testing a segment for validity occurs. If the segment is invalid, testing of the next segment occurs. If the segment is valid, execution depends on the destination:
Testing of transition segments stops and a transition path forms by backing up and including the transition segment from each preceding junction until the respective starting transition.
The states that are the immediate children of the parent of the transition path exit (see Exit an Active State).
The transition action from the final transition path executes.
The destination state becomes active (see Enter a State).
Junctions with no outgoing transition segments
Testing stops without any state exits or entries.
Junctions with outgoing transition segments
Step 1 is repeated with the set of outgoing segments from the junction.
After testing all outgoing transition segments at a junction, backtrack the incoming transition segment that brought you to the junction and continue at step 2, starting with the next transition segment after the backtrack segment. The set of flow charts finishes execution when testing of all starting transitions is complete.
Output edge-trigger event execution is equivalent to changing the value of an output data value. All other events have the following execution:
If the receiver of the event is active, then it executes (see Execute an Active Chart and Execute an Active State). (The event receiver is the parent of the event unless a direct event broadcast occurs using the send() function.)
If the receiver of the event is not active, nothing happens.
Early Return Logic
If the state is no longer active at the end of the event broadcast, any remaining steps in entering a state do not occur.
If the state is no longer active at the end of the event broadcast, any remaining exit actions and steps in state transitioning do not occur.
If the state is no longer active at the end of the event broadcast, any remaining steps in executing an active state do not occur.
If the origin state of the inner or outer flow chart or parent state of the default flow chart is no longer active at the end of the event broadcast, the remaining steps in the execution of the set of flow charts do not occur.
If the parent of the transition path is not active or if that parent has an active child, the remaining transition actions and state entry do not occur.