Stateflow    

Default Transition in Exclusive (OR) Decomposition Example

This example shows a transition from an OR state to a superstate with exclusive (OR) decomposition, where a default transition to a substate is defined.

Initially the Stateflow diagram is asleep. State A is active. Event E_one occurs and awakens the Stateflow diagram. Event E_one is processed from the root of the Stateflow diagram down through the hierarchy of the Stateflow diagram:

  1. The Stateflow diagram root checks to see if there is a valid transition as a result of E_one. There is a valid transition from state A to superstate B.
  2. State A exit actions (exitA()) execute and complete.
  3. State A is marked inactive.
  4. The transition action, A, is executed and completed.
  5. State B is marked active.
  6. State B entry actions (entB()) execute and complete.
  7. State B detects a valid default transition to state B.B1.
  8. State B.B1 is marked active.
  9. State B.B1 entry actions (entB1()) execute and complete.
  10. The Stateflow diagram goes back to sleep, waiting to be awakened by another event.

This sequence completes the execution of this Stateflow diagram associated with event E_one when state A is initially active.


  Default Transition Examples Default Transition to a Junction Example