States

States are conditions which a system or sub-system can be in during system operation.

Context

States can have an entry to specify the first executed behavior after the modeled system or sub-system enters the state, an exit to specify the last executed behavior before the modeled system or sub-system leaves the state, and a do to specify the behavior that happens in between the entry and exit.

To describe the sub-states within a complex state, create a sub-diagram for it or create nested symbols inside the state.

In this example, Computer Monitor Power On is a composite state with the Power Light On entry behavior and the Power Light Off exit behavior. The composite state contains sub-states 1024*768pixels and 1280*1024pixels.

Procedure

  1. Drag the State tool from the toolbox and drop it on your diagram.

    The following properties are available on the Info tab in the General category:

    Property

    Description

    Name/Code/Comment

    Identify the object. The name should clearly convey the object's purpose to non-technical users, while the code, which is used for generating code or scripts, may be abbreviated, and should not normally include spaces. You can optionally add a comment to provide more detailed information about the object. By default the code is synchronized with the name. To decouple name-code synchronization, enter a new code in the Code field.

  2. [optional] In the Info tab under categories Entry, Do and Exit, respectively specify the Behavior Type. The following options are available:
    • Activity Block - Reference an activity block in your model. Specify the activity block in the Behavior Object field.

    • Operation/Reception - If the state machine block which owns the diagram is associated to a block, you can reference the block's operations or receptions as the behavior type. Specify the block and the operation/reception respectively in the Parent Block and Behavior Object fields. Map the operation/reception parameters to the block's value properties in the Parameter Mappings table as appropriate.

    • Textual Expression - Manually enter the expression in the Text field.

  3. Select the state to open its context menu. The following tools are available on the state's context menu.

    Tool

    Details

    State - Create the next state in the flow.

    Display/Hide Entry - Display or hide the Entry information in the state symbol.

    Display/Hide Do - Display or hide the Do information in the state symbol.

    Display/Hide Exit - Display or hide the Exit information in the state symbol.

    Region - Create a new region in the state. See Regions.

    Link – Provides an alternative way to create a link. Select the tool and connect two objects with a default link, then choose Change Link Type to change to another link as appropriate.

    This tool is available in both the diagram toolbox and in the context menu of the relevant objects.

  4. [optional] To create substates as nested symbols inside the state, drag the State tool from the toolbox and drop it inside the state.
  5. [optional] To create a new state machine diagram as the sub-diagram of the state, double-click the state.
    The new diagram opens in a new tab. The diagram is initialized with a frame, which represents the boundary of the state.