Submachines Submachines Submachines enable you to manage the complexity of large statecharts by decomposition. The original statechart is called the parent , whereas the decomposed part is called the submachine . Creating a submachine You can create a submachine from a complex state using either the Edit menu or the menu for the state. To create a submachine. on a statechart, right-click a state and then select Create Sub-Statechart . Rational Rhapsody creates a submachine called . , which is a new statechart consisting of the submachine state and its contents. If you decompose the doorClosed state into a submachine, Rational Rhapsody creates a new submachine.
Actions and reactions move into the top state of the submachine if the transition goes to the submachine state, and inside the submachine if the transition goes into the nested part. Note You cannot create submachines of inherited states. The workaround is to add a dummy state as a child of the inherited state and make that the submachine state. Opening a submachine or parent statechart To open a submachine, right-click the submachine state in the parent statechart and select Open Sub-Statechart . Similarly, to open a parent statechart from a submachine, right-click the top state and select Open Parent Statechart .
Deep transitions A deep transition is a cross-chart transition, for example, from a parent statechart into a submachine, or vice versa. When you create a submachine, deep transitions are automatically split via substates. Consider the following example: Rational Rhapsody 765