Editing Statechart

The actions available for editing a Statechart include the following. Further editing options can be found under editor.

Adding a new element

1. Open the Toolbox window via the View menu.
2. Select an element in the Toolbox view and drag & drop it onto the opened Statechart. Drop it in a suitable location to visualize it there.
The new element is shown in the diagram.

Deselect “Toolbox” view

An element is selected in the Toolbox window. In the editor the cursor has the form of the selected element.
1. Press the right mouse button.
The element is deselected, and the standard Pointer element is selected.

Editing identifiers

1. Open the line editor of an identifier with two single clicks.
2. Enter a new name and confirm it via the [Enter] key or by clicking in an empty area of the diagram.
Editing Statechart 1:
The identifier has the new name.

Adding a new action object

1. Click on the symbol New <ENTRY/DO/EXIT> action/method, which appears at the end of an action line for a state and at the start of an action line for a composite state.
Requirement: So far the action line has no declaration or implementation.

Editing Statechart 2:

Editing Statechart 3:
The dialog New action object opens.
2. Specify the object type in the left part of the dialog by selecting Action or Method.
3. If the object type Action is selected: Configure the name and the implementation language for the new action.
If the object type Method is selected: Configure the name, the return type, the implementation language and the access modifier for the new method.
Editing Statechart 4:
4. Confirm the inputs and configurations with the Add button.
The new action or method object is added to the project tree and displayed as linked object in the edited state. In addition, the editor for the new action or the new method opens.

Editing Statechart 5:

Creating a new transition

Transitions can be created based on various source elements: start state, state, composite state, choice, fork/join.
The possible target elements, for which an incoming transition is created, depend on the source element type and the transition type (transition, completion transition, exception transition).

The general procedure for generating a transition is explained below.

Option 1 – via icon:

1. Select an element in the opened Statechart.
2. Click on a transition icon, which appears above the element (the selected element acts as source element).
3. Click on an existing element to configure it as target element for the selected transition. Alternatively, click in a blank area of the editor to generate a new state.
4. Configure the action and the guard condition for the transition as required by opening the respective line editors with two single clicks. If the guard condition depends on more than one variable, you can insert a new line via [Ctrl+Enter] during the configuration of the transition condition, in order to show the whole transition more clearly.
You have created a transition from source to target element, which determines the switching characteristics of the Statechart.

Option 2 – via Toolbox:

1. Click on a transition element from Toolbox.
2. In the open Statechart first click on the source element, then on an existing element in order to configure it as target element for the selected transition. Alternatively, click in a blank area of the editor to generate a new state.
3. Configure the action and the guard condition for the transition as required by opening the respective line editors with two single clicks. If the guard condition depends on more than one variable, you can insert a new line via [Ctrl+Enter] during the configuration of the transition condition, in order to show the whole transition more clearly.
You have created a transition from source to target element, which determines the switching characteristics of the Statechart.

Changing the end points of an existing transition

The end points of an existing transition can be linked to other source or target elements using the Reconnect functionality. As a result, existing transition configurations (action, guard condition) are retained, while the transition connections change.

1. Click on the start or the end of a transition, depending on whether you want to change the source element or the target element.
The reconnect symbol appears at the transition connection.

Editing Statechart 6:
2. Drag & drop the symbol onto another source or target element to connect the transition there.
The transition was linked to another source/target element, without changing the other transition configurations.

As project navigator

1. Open a Statechart and double-click on an action object of a (composite) state.
The editor for the action object opens.
2. If required, you can change the declaration and implementation of the action object in the open editor.
Use the project navigator functionality to view or adjust the behavior of the selected action object.

Multiple selections