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:

  1. The Stateflow diagram root checks to see if there is a valid transition at the root level as a result of E_one. There is no valid transition.
  2. State A during actions (durA()) execute and complete.
  3. State A checks itself for valid transitions and detects that there is a valid inner transition to a connective junction.
  1. The conditions are evaluated to determine whether one of the transitions is valid. 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 [C_two] is true, the inner transition to the junction and then to state A.A2 is valid.

  1. State A.A1 exit actions (exitA1()) execute and complete.
  2. State A.A1 is marked inactive.
  3. State A.A2 is marked active.
  4. State A.A2 entry actions (entA2()) execute and complete.
  5. 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 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:

  1. The Stateflow diagram root checks to see if there is a valid transition at the root level as a result of E_one. There is no valid transition.
  2. State A during actions (durA()) execute and complete.
  3. State 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.
  4. State A.A2 exit actions (exitA2()) execute and complete.
  5. State A.A2 is marked inactive.
  6. State A.A3 is marked active.
  7. State A.A3 entry actions (entA3()) execute and complete.
  8. 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 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