Stateflow    

Connective Junctions

Connective junctions are decision points in the system. A connective junction is a graphical object that simplifies Stateflow diagram representations and facilitates generation of efficient code. Connective junctions provide alternative ways to represent desired system behavior. In the diagram on page 2-10, the connective junction is used as a decision point for two transition segments that complete at StateA1c.

Transitions connected to junctions are called transition segments. Transitions, apart from default transitions, must go state to state. However, once the transition segments taken complete a state to state transition, the accumulation of the transition segments taken forms a complete transition.

The following example shows how connective junctions (displayed as small circles) are used to represent the flow of an if-else code structure shown in accompanying pseudocode.

This example executes as follows:

  1. If condition [c1] is true, condition action a1 is executed and the default transition to the top junction is taken.
  2. Stateflow now considers which transition segment to take out of the top junction (it can take only one). Junctions with conditions have priority over junctions without conditions, so the transition with the condition [c2] is considered first.
  3. If condition [c2] is true, action a2 is executed and the transition segment to the bottom junction is taken. Because there are no outgoing transition segments from the bottom junction, the diagram is finished executing.
  4. If condition [c2] is false, the empty transition segment on the right is taken (because it has no condition at all).
  5. If condition [c3] is true, condition action a3 is executed and the transition segment from the middle to the bottom junction is taken. Because there are no outgoing transition segments from the bottom junction, the diagram is finished executing.
  6. If condition [c3] is false, execution is finished at the middle junction.

The above steps describe the execution of the example diagram for connective junctions with Stateflow semantics. Stateflow semantics describe how objects in diagrams relate to each other during execution. See Stateflow Semantics.


  Actions Stateflow Hierarchy of Objects