Stateflow | ![]() ![]() |
Execution Order Guidelines
Execution order of transitions originating from the same source is based on these guidelines. The guidelines appear in order of their precedence:
A
.A1
is active, the transition from state A
.A1
to state B
is valid and takes precedence over the transition from state A
.A1
to state A
.A2
based on the hierarchy.Junctions
Multiple outgoing transitions from junctions that are of equivalent label priority are evaluated in a clockwise progression starting from a twelve o'clock position on the junction.
In this example, the transitions are of equivalent label priority. The conditions [C_three
== 3]and [C_four
== 4] are both true. Given that, the outgoing transitions from the junction are evaluated in this order:
A
-> B
Since the condition [C_one
== 1] is false, this transition is not valid.
A
-> C
Since the condition [C_two
== 2] is false, this transition is not valid.
A
-> D
Since the condition [C_three
== 3] is true, this transition is valid and is
taken.
A
-> E
This transition, even though it too is valid, is not evaluated since the previous transition evaluated was valid.
States
Multiple outgoing transitions from states that are of equivalent label priority are evaluated in a clockwise progression starting at the upper, left corner of the state.
In this example, the transitions are of equivalent label priority. The conditions [C_two
== 2] and [C_three
== 3] are both true and [C_one
= = 1] is false. Given that, the outgoing transitions from the state are evaluated in this order:
A
-> B
Since the condition [C_one
== 1] is false, this transition is not valid.
A
-> C
Since the condition [C_two == 2] is true, this transition is valid and is taken.
A
-> D
This transition, even though it too is valid, is not evaluated since the previous transition evaluated was valid.
![]() | Execution Order | Parallel (AND) States | ![]() |