Stateflow | ![]() ![]() |
Processing Events with an Inner Transition to a Connective Junction Example
This example shows the behavior of handling repeated events using an inner transition to a connective junction.
Processing the First Event with an Inner Transition to a Connective Junction
This example shows the behavior of an inner transition to a connective junction for an initial event.
Initially the Stateflow diagram is asleep. State A1
is active. Event E_one
occurs and awakens the Stateflow diagram. Condition [C_two]
is true. Event E_one
is processed from the root of the Stateflow diagram down through the hierarchy of the Stateflow diagram:
E_one
. There is no valid transition.
A
during actions (durA()
) execute and complete.
A
checks itself for valid transitions and detects that there is a valid inner transition to a connective junction.
[C_two]
is true, the inner transition to the junction and then to state A
.A2
is valid.
A
.A1
exit actions (exitA1()
) execute and complete.
A
.A1
is marked inactive.
A
.A2
is marked active.
A
.A2
entry actions (entA2()
) execute and complete.
This sequence completes the execution of this Stateflow diagram associated with event E_one
when condition C_two
is true.
Processing a Second Event with an Inner Transition to a Connective Junction
Continuing the previous example, this example shows the behavior of an inner transition to a junction when a second event E_one
occurs.
Initially the Stateflow diagram is asleep. State A2
is active. Event E_one
occurs and awakens the Stateflow diagram. Neither [C_one]
nor [C_two]
is true. Event E_one
is processed from the root of the Stateflow diagram down through the hierarchy of the Stateflow diagram:
E_one
. There is no valid transition.
A
during actions (durA()
) execute and complete.
A
checks itself for valid transitions and detects a valid inner transition to a connective junction. The segments labeled with a condition are evaluated before the unlabeled segment. The evaluation starts from a twelve o'clock position on the junction and progresses in a clockwise manner. Because neither [C_one]
nor [C_two]
is true, the unlabeled transition segment is evaluated and is determined to be valid. The full transition from the inner transition to state A
.A3
is valid.
A
.A2
exit actions (exitA2()
) execute and complete.
A
.A2
is marked inactive.
A
.A3
is marked active.
A
.A3
entry actions (entA3()
) execute and complete.
This sequence completes the execution of this Stateflow diagram associated with event E_one
when neither [C_one]
nor [C_two]
is true.
![]() | Processing Events with an Inner Transition in an Exclusive (OR) State Example | Inner Transition to a History Junction Example | ![]() |