Working with composite states

A composite state is an aggregate of one or more states. Use one or more of them to decompose a complex state machine diagram into an easy to comprehend hierarchy of state machines.

You can either create an empty composite state (in that it contains an initial and final state but nothing else), or create one from existing objects on your canvas. Both techniques are described below. When done, you can work with both of them in the same way.
  1. To create an empty composite state, proceed as follows:
    1. In the palette, click the composite state icon (The composite state activity icon).
    2. Drag the cursor out over the canvas. You will notice that the icon beside your cursor has a plus symbol when you are at a place where you are allowed to drop the state. When the cursor becomes a crossed out circle, continue moving the cursor until it becomes a plus sign again.
    A new composite state will appear on the canvas. You will notice that it automatically has an Initial and Final state. Proceed to step 3.
  2. To create a composite state from existing objects on the canvas, proceed as follows:
    1. Using the selector (The selector icon), choose the objects that you want to include in the new composite state.
    2. Right-click the selection, and click Add to composite state.
    A new composite state will appear on the canvas populated with the objects that you selected.
  3. Work with the composite state as necessary. You can populate it with objects from the palette, link it to other objects on the canvas, or add exit and entry elements.
  4. When done, you can collapse the state by clicking the dark vertical triangle (The vertical triangle icon), and then expand it again by clicking the horizontal triangle (The horizontal triangle icon).
Related tasks
Adding a state to a state machine
Adding an entry or an exit action to a state
Adding a transition to a state machine

Feedback
(C) Copyright IBM Corporation 2005, 2007. All Rights Reserved.