| Stateflow | ![]() |
If-Then-Else Decision Construct Example
This example shows the behavior of an if-then-else decision construct.
Initially the Stateflow diagram is asleep. State A 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:
A to the connective junction. The transition segments beginning from a twelve o'clock position on the connective junction are evaluated for validity. The first transition segment, labeled with condition [C_one], is not valid. The next transition segment, labeled with the condition [C_two], is valid. The complete transition from state A to state C is valid.
A exit actions (exitA()) execute and complete.
A is marked inactive.
C is marked active.
C entry actions (entC()) execute and complete.
This sequence completes the execution of this Stateflow diagram associated with event E_one.
| Label Format for Transition Segments Example | Self-Loop Transition Example | ![]() |