Click or drag to resize
StaMaRegion Shape

Explains the visual appearance, usage, context menus and properties of the region shape.

The region shape is one of the 4 principal shapes used to compose a state diagram.

The region shape is the grouping container for state shapes.

Every state machine diagram must contain a top level region shape which is the container for all states of the state machine.

Region shapes can further be embedded into state shapes which makes the state a composite state. This is accomplished by first converting the state shape to a composite state shape and then adding the region shape as a grouped object to the state shape. A detailed description about this procedure can be found in Create a Composite State.

Region Shape Root Region And Composite State
Figure 1: Root region with two states, composite state containing one and composite state containing two sub-regions

The region shape has a property to define its sequential order in the generated code (execution order) and a property to enable the shallow history function.

The value of the execution order property is shown in a rectangle in the lower left corner of the region.

A circle in the lower left corner containing an "H" indicates that the region has a history. If needed, this history marker can be moved to a different place by dragging its yellow diamond.

Region Shape History
Figure 2: Sub-region with history

The initial state of the region, needed for the StateMachineTemplateRegion(String, Boolean) method, is defined through a transition segment shape of type Initial State which is connected to a state within the region.

What Do You Want to Do?
Region Shape Properties

The region shape has a properties dialog that can be opened either by double clicking on the execution order rectangle or by opening the context menu on the execution order rectangle and executing the menu item Properties....

Region Properties
Figure 3: Region shape properties

The properties are as follows:

Property

Purpose

Execution Order

In the generated code sub-regions of a composite state are ordered alphabetically according to this property. Any text is allowed here, only the alphabetical sort order is relevant. This property can be used to give the region a speaking name within the diagram, as long as the execution order of the generated code is not affected in an unintended way.

History

Indicates if the region has a shallow history. This property is used in the code generator to fill the corresponding StateMachineTemplateRegion(String, Boolean) method parameter.

Region Shape Context Menu

The region shape has the following additional context menu items:

Context Menu Item

Purpose

Show Sub-States

Opens a new window that opens the Microsoft Visio group of the region, usually containing only the states of the region.

See Also