Statemachine Diagram

Statemachine diagram represents the states in an object and their transitions.

image

Creating a Statemachine Diagram

Statemachine diagrams can be added by the following procedure:

  • Click [Statemachine Diagram] from [Diagram] on the Main Menu.

  • Use the context menu from [Structure] in [Project View].


Diagram Elements of the Statemachine Diagram

image
Description of each icon

Type

Icon

Description

Select

select_icon

The basic operations of the Diagram Editor can be executed in this mode.

InitialPseudostate

initial_state_icon

Add an InitialPseudostate.

State

action_state_icon

Add a State.

SubmachineState

submachinestate_icon

Add a SubmachineState.

FinalState

final_state_icon

Add a FinalState.

Transition

asso_with_nav_icon

Add a Transition.

EntryPoint

entrypoint_icon

Add an EntryPoint.

ExitPoint

exitpoint_icon

Add an ExitPoint.

ShallowHistory

shallow_h_icon

Add an ShallowHistory.

DeepHistory

deep_h_icon

Add an DeepHistory.

JunctionPoint

junction_point_icon

Add a JunctionPoint

Choice

choicepseudostate_icon

Add a Choice.

ForkPseudostate

fork_icon

Add a ForkPseudostate.

ForkPseudostate

rotated_fork_icon

Add a landscape ForkPseudostate. Select from the pull-down of the ForkPseudostate icon.

JoinPseudostate

join_icon

Add a JoinPseudostate.

JoinPseudostate

rotated_join_icon

Add a landscape JoinPseudostate. Select from the pull-down of the JoinPseudostate icon.

Refer to Common Diagram Elements for information on other items.


InitialPseudostate

Creating an InitialPseudostate

InitialPseudostate can be created by the following procedure:

  • Select [InitialPseudostate] initial_state_icon in the Tool Bar and click on the diagram.

Note

A state cannot have multiple InitialPseudostates.


State

Creating a State

State can be created by the following procedure: To insert a line break in the name, click either SHIFT + ENTER, ALT + ENTER, or CTRL + ENTER.

  • Double-click on the Activity diagram.

  • Select [State] action_state_icon in the Tool Bar and click on the diagram.

image

Inserting the State in the Transition

The newly created State can be inserted in the Transition.
The procedure below describes how to insert a new State in the Transition created between two States.
  1. Select action_state_icon [State] in the Tool Bar.

  2. Mouse over the Transition and click on the highlighted Transition.

The connection status between the Transition and new State changes depending on the clicking position in the Transition.

  • Clicking on the start side of the Transition reconnects the start side of the Transition to the newly inserted State.
    In addition, a new Transition is created with the inserted State as its end side.
    The guideline is that the start side of the existing Transition is highlighted in a round shape as shown in the figure below.
    image
  • Clicking on the end side of the Transition reconnects the end side of the Transition to the newly inserted State.
    In addition, a new Transition is created with the inserted State as its start side.
    The guideline is that the end side of the existing Transition is highlighted in a round shape as shown in the figure below.
    image

Editing the State

Adding a Region

Region can be added by the following procedure:

  • Select [Add Region] from the context menu.

image

Deleting the Region

Region can be deleted by the following procedure:

  • Select [Delete Region] from the context menu.

Adding an Action

Action can be added by the following procedure:

  • Select [Add Action] from the context menu of the State and click the Action to add ([Add Entity]/[Add Do]/[Add Exit]).

image

Deleting the Action

Action can be deleted by the following procedure:

  • Select [Delete Action] from the context menu of the State and click the Action to delete ([Delete Entity]/[Delete Do]/[Delete Exit]).

  • Delete from the [Entry/Do/Exit] tab of the Property View.

Add an Internal Transition

Internal Transition can be added by the following procedure:

  1. Select [Add Internal Transition] from the context menu of the State.

  2. Double-click the Internal Transition and enter the names of “trigger”, [guard], and “/action”.

To insert a line break in the name, click either SHIFT + ENTER, ALT + ENTER, or CTRL + ENTER.

  • Add from the [Internal Transition] tab of the Property View.

image

Note

When entering the Internal Transition on the diagram, enclose the guard condition with [ ] and add “/” at the beginning of the Action.

Deleting an Internal Transition

Internal Transition can be deleted by the following procedure:

  • Delete from the [Internal Transition] tab of the Property View.

Editing the State Name

State Name can be edited by the following procedure:

  • Double-click the name of the Diagram Element on the diagram editor and edit the name.

  • Edit from the [Base] tab in the Property View.

Action Visibility

Set whether to show or hide the Action by the following procedure:

  • Select [Action Visibility] from the context menu to switch the visibility.

Adding a Stereotype

Stereotype can be added by the following procedure:

  • Select [Add Stereotype] from the context menu.

  • Add a stereotype from the [Stereotype] tab of the Property View.


SubmachineState

Creating a SubmachineState

SubmachineState can be created by the following procedure:

  • Select the Statemachine diagram that to be the SubmachineState in [Structure] and drag and drop it to the Statemachine diagram open in the Diagram Editor.

image
  1. Select [SubmachineState] submachinestate_icon in the Tool Bar and click on the diagram.

  2. Select [Create a new model] or [Select an existing model] and specify the Statemachine diagram to associate from the pull-down.

  3. Click the [OK] button.

  • When [Create a new model] is selected, a new Statemachine diagram is created.

  • When [Select an existing model] is selected, the Statemachine diagram specified in the pull-down is associated.

image

Editing the SubmachineState

Adding an Action

Action can be added by the following procedure:

  • Select [Add Action] from the context menu and select the Action to add ([Add Entity]/[Add Do]/[Add Exit]).

  • Add from the [Entry/Do/Exit] tab of the Property View.

Deleting the Action

Action can be deleted by the following procedure:

  • Select [Delete Action] from the context menu and select the Action to delete ([Delete Entity]/[Delete Do]/[Delete Exit]).

  • Delete from the [Entry/Do/Exit] tab of the Property View.

Add an Internal Transition

Internal Transition can be added by the following procedure:

  • Select [Add Internal Transition] from the context menu and enter the names of “trigger”, [guard], and “/action”.

  • Add from the [Internal Transition] tab of the Property View.

image

Deleting the Internal Transition

Internal Transition can be deleted by the following procedure:

  • Delete from the [Internal Transition] tab of the Property View.

Editing the SubmachineState Name

SubmachineState name can be edited by the following procedure:

  • Edit from the [Base] tab in the Property View.

  • With the diagram element-like SubmachineState name selected, click it again to enter the edit mode and edit.

Opening the Associated Statemachine Diagram

Statemachine associated with the SubmachineState can open by the following procedure:

  • Select [Open Diagram] from the context menu of the SubmachineState.

  • Double-click the SubmachineState on the Diagram Editor.


FinalState

Creating a FinalState

FinalState can be created by the following procedure:

  • Select [FinalState] final_state_icon in the Tool Bar and click on the diagram.


Transition

Creating a Transition

Transition can be created by the following procedure:

  • Select [Transition] asso_with_nav_icon in the Tool Bar.

  • Select [Transition] asso_with_nav_icon in the Draw Suggest.

image

When the Transition from the State/SubmachineState is created, “Trigger” is added to it. When the Transition from the JunctionPoint/Choice is created, “Guard” is added to it.

Editing the Transition

Setting the Action of the Transition

Transition can be edited by the following procedure: To insert a line break in the name, click either SHIFT + ENTER, ALT + ENTER, or CTRL + ENTER.

  • Double-click the name of the Diagram Element on the diagram editor and edit the name.

  • Edit from the [Base] tab in the Property View.


EntryPoint and ExitPoint

Creating EntryPoint and ExitPoint

EntryPoint and ExitPoint can be created by the following procedure:

  • Select [EntryPoint] entrypoint_icon in the Tool Bar and click the State/SubmachineState.

image
  • Select [ExitPoint] exitpoint_icon in the Tool Bar and click the State/SubmachineState.

image

Editing the EntryPoint and ExitPoint

Editing the Name

Name can be edited by the following procedure:

  • Double-click the name of the Diagram Element on the diagram editor and edit the name.

  • Edit from the [Base] tab in the Property View.

Editing the Definition

Definition can be edited by the following procedure:

  • Edit from the [Base] tab in the Property View.


ShallowHistoryPseudostate and DeepHistoryPseudostate

Creating a HistoryPseudostate

HistoryPseudostate can be created by the following procedure:

  • Select [ShallowHistoryPseudostate] shallow_h_icon in the Tool Bar and click on the diagram.

  • Select [DeepHistoryPseudostate] deep_h_icon in the Tool Bar and click on the diagram.

ShallowHistoryPseudostate

DeepHistoryPseudostate

h1

h2

Note

Only one of each HistoryPseudostate can be created in the Statemachine diagram.


JunctionPoint

Creating a JunctionPoint

JunctionPoint can be created by the following procedure:

  • Select [JunctionPoint] junction_point_icon in the Tool Bar and click on the diagram.


Choice

Creating a Choice

Choice can be created by the following procedure:

  • Select [Choice] choicepseudostate_icon in the Tool Bar and click on the diagram.


ForkPseudostate and JoinPseudostate

Creating ForkPseudostate and JoinPseudostate

Select either of the items below in each Tool Bar and click on the diagram.

ForkPseudostate

fork_icon rotated_fork_icon

JoinPseudostate

join_icon rotated_join_icon