Connective Junctions

A connective junction enables representation of different possible transition paths for a single transition. Connective junctions are used to help represent the following:

  • Variations of an if-then-else decision construct, by specifying conditions on some or all of the outgoing transitions from the connective junction

  • A self-loop transition back to the source state if none of the outgoing transitions is valid

  • Variations of a for loop construct, by having a self-loop transition from the connective junction back to itself

  • Transitions from a common source to multiple destinations

  • Transitions from multiple sources to a common destination

  • Transitions from a source to a destination based on common events

    Note

    An event cannot trigger a transition from a connective junction to a destination state.

See Represent Multiple Paths by Using Connective Junctions for a summary of the semantics of connective junctions.

Flow Chart Notation with Connective Junctions

Flow chart notation uses connective junctions to represent common code structures like for loops and if-then-else constructs without the use of states. And by reducing the number of states in your Stateflow® charts, flow chart notation produces efficient simulation and generated code that helps optimize memory use.

Flow chart notation uses combinations of the following:

  • Transitions to and from connective junctions

  • Self-loops to connective junctions

  • Inner transitions to connective junctions

Flow chart notation, states, and state-to-state transitions coexist in the same Stateflow chart. The key to representing flow chart notation is in the labeling of transitions, as shown in the following examples.

Connective Junction with All Conditions Specified Example

A transition from the Front_desk state to a connective junction is labeled by the check_in event. Transitions from the connective junction to the destination states are labeled with conditions. If Front_desk is active when check_in occurs, the transition from Front_desk to the connective junction occurs first. The transition from the connective junction to a destination state depends on which of the room_type conditions is true. If none of the conditions is true, no transition occurs and Front_desk remains active.

For more information about this chart, see Phases of Chart Execution. For more information on the semantics of this notation, see If-Then-Else Decision Construct.

Connective Junction with One Unconditional Transition Example

The chart uses temporal logic to determine when the input u equals 1.

If the input equals 1...A transition occurs from...
Before t = 2Start to Fast
Between t = 2 and t = 5Start to Good
After t = 5Start to Slow

For more information about temporal logic, see Control Chart Execution by Using Temporal Logic. For more information on the semantics of this notation, see If-Then-Else Decision Construct.

Connective Junction and For Loops Example

This example shows a combination of flow chart notation and state transition notation. Self-loop transitions to connective junctions can represent for loop constructs. The chart uses implicit ordering of outgoing transitions (see Implicit Ordering).

See For-Loop Construct for information on the semantics of this notation.

Flow Chart Notation Example

This example shows the use of flow chart notation. The chart uses implicit ordering of outgoing transitions (see Implicit Ordering).

See Flow Chart Notation for information on the semantics of this notation.

Connective Junction from a Common Source to Multiple Destinations Example

This example shows transition segments from a common source to multiple conditional destinations using a connective junction. The chart uses implicit ordering of outgoing transitions (see Implicit Ordering).

See Transition from a Common Source to Multiple Destinations for information on the semantics of this notation.

Connective Junction Common Events Example

This example shows transition segments from multiple sources to a single destination based on the same event using a connective junction.

See Transition from a Source to a Destination Based on a Common Event for information on the semantics of this notation.

Change Connective Junction Size

  1. Select one or more connective junctions.

  2. Right-click one of the selected junctions and select Junction Size from the drop-down menu.

  3. From the menu, select a junction size.

Modify Connective Junction Properties

  1. Right-click a connective junction and select Properties from the drop-down menu.

  2. In the Connective Junction dialog box, edit the fields in the dialog box according to your requirements.

    Field

    Description

    Parent

    Parent of the connective junction (read-only). To bring the parent to the foreground, click the hypertext link.

    Description

    Textual description or comment.

    Document link

    Link to other information. Enter a URL address or a general MATLAB® command. Examples are www.mathworks.com, mailto:email_address, and edit/spec/data/speed.txt.

  3. To save changes, click Apply.