Statemachine Diagram¶
Statemachine diagram represents the states in an object and their transitions.
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¶
¶ Type
Icon
Description
Select
The basic operations of the Diagram Editor can be executed in this mode.
InitialPseudostate
Add an InitialPseudostate.
State
Add a State.
SubmachineState
Add a SubmachineState.
FinalState
Add a FinalState.
Transition
Add a Transition.
EntryPoint
Add an EntryPoint.
ExitPoint
Add an ExitPoint.
ShallowHistory
Add an ShallowHistory.
DeepHistory
Add an DeepHistory.
JunctionPoint
Add a JunctionPoint
Choice
Add a Choice.
ForkPseudostate
Add a ForkPseudostate.
ForkPseudostate
Add a landscape ForkPseudostate. Select from the pull-down of the ForkPseudostate icon.
JoinPseudostate
Add a JoinPseudostate.
JoinPseudostate
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] 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] in the Tool Bar and click on the diagram.
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.
Select [State] in the Tool Bar.
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. 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.
Editing the State¶
Adding a Region¶
Region can be added by the following procedure:
Select [Add Region] from the context menu.
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]).
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:
Select [Add Internal Transition] from the context menu of the State.
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.
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.
Select [SubmachineState] in the Tool Bar and click on the diagram.
Select [Create a new model] or [Select an existing model] and specify the Statemachine diagram to associate from the pull-down.
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.
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.
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] in the Tool Bar and click on the diagram.
Transition¶
Creating a Transition¶
Transition can be created by the following procedure:
Select [Transition] in the Tool Bar.
Select [Transition] in the Draw Suggest.
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] in the Tool Bar and click the State/SubmachineState.
Select [ExitPoint] in the Tool Bar and click the State/SubmachineState.
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] in the Tool Bar and click on the diagram.
Select [DeepHistoryPseudostate] in the Tool Bar and click on the diagram.
ShallowHistoryPseudostate |
DeepHistoryPseudostate |
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] in the Tool Bar and click on the diagram.
Choice¶
Creating a Choice¶
Choice can be created by the following procedure:
Select [Choice] in the Tool Bar and click on the diagram.