| Contents | Index |
| On this page… |
|---|
Drawing a Supertransition Into a Subchart |
A supertransition is a transition between different levels in a chart, for example, between a state in a top-level chart and a state in one of its subcharts, or between states residing in different subcharts at the same or different levels in a chart. You can create supertransitions that span any number of levels in your chart, for example, from a state at the top level to a state that resides in a subchart several layers deep in the chart.
The point where a supertransition enters or exits a subchart is called a slit. Slits divide a supertransition into graphical segments. For example, the following chart shows a supertransition leaving the On subchart:

The same supertransition appears inside the subchart as follows:

In this example, supertransition [Heater.On.warm()] goes from NORM in the On subchart to the Off state in the parent chart. Both segments of the supertransition have the same label.
Use the following steps to draw a supertransition from an object outside a subchart to an object inside the subchart.
Note You cannot undo the operation of drawing a supertransition. When you perform this operation, the undo and redo buttons are disabled from undoing and redoing any prior operations. |
Position your pointer over the border of the state.
The pointer assumes the crosshairs shape.

Dragging the mouse causes a supertransition segment to appear. The segment looks like a regular transition. It is curved and is tipped by an arrowhead.

Drag the segment's tip anywhere just inside the border of the subchart.
The arrowhead now penetrates the slit.

If you are not happy with the initial position of the slit, you can continue to drag the slit around the inside edge of the subchart to the desired location.
Continue dragging your pointer toward the center of the subchart.
A wormhole appears in the center of the subchart.

A wormhole allows you to open a subchart while drawing a supertransition.
Drag your pointer over the center of the wormhole.
The subchart opens. Now the wormhole and supertransition are visible inside the subchart.

Drag and drop the tip of the supertransition anywhere on the border of the object that you want to terminate the transition.

Note If the terminating object resides within a subchart in the current subchart, continue to drag the tip of the supertransition through the wormhole of the inner subchart and complete the connection inside the inner chart. In this way, you can draw a supertransition to an object at any subchart depth in the chart. |
Use the following steps to draw a supertransition out of a subchart.
Caution You cannot undo the operation of drawing a supertransition. When you perform this operation, the undo and redo buttons are disabled from undoing and redoing any prior operations. |
Draw an inner transition segment from the source object anywhere just outside the border of the subchart
A slit appears as shown.

Keep dragging the transition away from the border of the subchart.
A wormhole appears.

Drag the transition down the wormhole.
The parent of the subchart appears.


Note If the parent chart is itself a subchart and the terminating object resides at a higher level in the subchart hierarchy, you can continue drawing by dragging the supertransition into the border of the parent subchart. In this way, you can connect objects separated by any number of layers in the subchart hierarchy. |
A supertransition is displayed with multiple resulting transition segments for each layer of containment traversed. For example, if you create a transition between a state outside a subchart and a state inside a subchart of that subchart, you create a supertransition with three segments, each displayed at a different containment level.
You can label any one of the transition segments constituting a supertransition using the same procedure used to label a regular transition (see Labeling Transitions). The resulting label appears on all the segments that constitute the supertransition. Also, if you change the label on any one of the segments, the change appears on all segments.
![]() | Using Subcharts to Encapsulate Modal Logic | Maintaining Transition Shapes with Smart Behavior | ![]() |

Learn how engineers use Stateflow to model state machines in their Simulink models.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |