Transitions
- Updated2026-04-22
- 6 minute(s) read
Learn how to manage transitions in PAgraph.
Creating Transitions
You can only create transitions in the graphical area. Transitions can only be created between two existing elements, because they always require a defined source and target element.
You have the following options to create transitions:
- Automatically create a transition when you create a new element by dragging it on the diagram area. A transition is automatically created between the source and target element.
- Subsequently create transitions by dragging between two existing elements in the diagram area.
All elements contained in the Toolbox are allowed as source or target element, except for the following:
- Comment
- Do4Ever
- DoAtStateChange
Move Transition
A transition must always have a source and a target element. Therefore, you cannot drag a transition to the empty diagram area.
To move a transition, you must mark it in the diagram area. Then you can drag the selected start or end points of the transition to the desired source or target element. The transition is moved to this element if it is allowed as a new start or end point.
In the following figure, on the left side the source state is changed, and on the right is the target state.

Rename Transition
Learn how to rename transitions in your diagrams to display the names in the code, explorer, and diagram area.
Transitions do not have a name once created. In the code view and in the Explorer, transitions are labeled with the state to which the transition leads. For example, to state 2 (2). Names do not display for such transitions in the diagram area. If you name the transitions, the name displays in the code view, Explorer, and diagram area.
You have the following options to rename transitions:
- Select the marked transition in the diagram area and press <F2>.
- In the diagram area, select Rename from the Context menu.
In all cases, the display of the transition name transforms into an input field. You can enter the new name in the input field.
You can reset the name so that it does not display the diagram area. To reset the name, complete the following steps:
- Switch to the Edit mode.
- Delete your name from the input field.
Delete Transitions
You have the following options to delete transitions:
- Select the transition in the Explorer or diagram area and press <Del>.
- In the Explorer or diagram area, select Delete from the Context menu.
Transitions With and Without Condition
Transitions that do not contain program code for the condition are marked as arrows with a solid line. Transitions that contain a condition are represented as arrows with a broken line.
| Condition | Display in Chart | Display in Explorer |
|---|---|---|
| No condition |
![]() |
![]() |
| With condition |
![]() |
![]() |
The program code for the condition is entered in the code entry for transitions in the code view.
Sequence of Transitions
The sequence of transitions applies when the conditions of at least two transitions that lead away from the active state are met at the same time.
A transition is executed when the transition condition is met or when the transition has no condition. If the active state has two transitions with a fulfilled condition at the same time, the order of the transitions in the Explorer is critical.
Example 1

In this example, Transition 1 has no condition. Transition 2 has a condition. Transition 2 is only checked after Transition 1. In addition, Transition 1 always executes. Therefore, Transition 2 never executes.
Example 2

In this example, Transition 1 is checked after Transition 2. If the condition for Transition 2 is met, Transition 2 executes. Transition 1 does not execute. If the condition for Transition 2 is not met, Transition 1 executes.
Using Bending Points
Transitions are always created as a straight line between the source and target element. By inserting bending points, you can influence the arrangement and position of these lines.
Insert Bending Points
To insert bending points at the corresponding transition, open the Context menu and select Insert Point from the Context menu. You can repeat this process as often as necessary.
Position Bending Point
Move the mouse over the bending point until the pointer changes to an arrow that points in four directions. Grab the bending point with the mouse and drag it to the desired location.
If a bend is exactly 90 °, the corner is rounded.
Remove Bending Point
To remove a bending point, move the mouse in the diagram area over this bending point until the mouse is a pointer. Open the Context menu and select Remove point.
Stop
Stop in a transition causes the successor state to only be entered in the next call cycle of the state machine. Without this Stop, the next state is immediately activated and the program code is executed in the initialization part.
All transitions are created by default without a Stop. If a Stop is desired, it must be explicitly created.
You can create a Stop using either of the following methods:
- Drag a Stop element from the Toolbox to the chart area. In this case, you must manually create the two transitions that lead to the Stop or go away from it.
- Select Stop from the Context menu for an existing transition.
State Machine with AnyTransitions
AnyTransitions are always checked at the start of a cycle before the code of the current state is executed. The code of the exit part of a state is executed before switching to the AnyTransition.
Example
In the example, consider the case where State 1 is active at the start of a new cycle. In addition, the condition of AnyTransition 1 is met. Then, the following sequence arises for code execution:
- exit part of State 1
- activity part of AnyTransition 1
- init part of State 3
- cyclic part of State 3
AnyTransitions are checked once in each cycle and then executed if necessary. If no Stop is defined between two states, the AnyTransitions are not checked again before entering the next state.
Related Information
- Code for Transitions
For each transition, you can write code for the transition condition and the activities associated with the transition.
- AnyTransition
AnyTransitions always have a target state to which the AnyTransitions lead. AnyTransitions never have an initial state from which the AnyTransitions lead away.



