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.
- To create an empty composite state, proceed as follows:
- In the palette, click the composite state icon (
).
- 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.
- To create a composite state from existing objects on the canvas,
proceed as follows:
- Using the selector (
), choose the objects that you want to include in the new composite
state.
- 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.
- 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.
- When done, you can collapse the state by clicking the dark vertical
triangle (
), and then expand it again by clicking the horizontal triangle (
).