RAD Studio (Common)
ContentsIndex
PreviousUpNext
Working with a Complex State

The techniques in this section pertain to models of particularly complex composite states and substates. 

You can resize the main state. You can also create a substate by drawing a state diagram within another state diagram and indicating start, end, and history states as well as transitions. 

Create a composite state by nesting one or more levels of states within one state. You can also place start/end states and a history state inside of a state, and draw transitions among the contained substates.

Use the following techniques to create a composite (nested) state:

  1. Create a nested substate using drag-and-drop
  2. Сreate a nested substate using the context menu of the state element

To create a nested substate using drag-and-drop:

  1. Place a state element on the diagram background.
  2. Drag a new state on top of an existing state.
  3. Drop a new state.

To create a nested substate using the context menu of the state element:

  1. Right-click the state (region) that will be the container.
  2. Select AddState on the context menu.
Tip: You can nest multiple levels of substates inside one state. For especially complex substate modeling, however, you can find it more convenient to create different diagrams, model each of the substate levels individually, and then hyperlink the diagrams sequentially. 

Using the Shortcuts command on the context menu of the diagram, you can reuse existing elements in other state diagrams. Right-click the diagram and choose Add -> Shortcuts, navigate within the pane containing the tree view of the available project contents for the project group to the existing diagram, and select its elements, states, histories, forks, and/or joins.

Tip: Using the context menu of the state element, you can also create all of the other subelements that a state can contain.
Tip: Only one History element can be created within one state.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!