Statechart transition labels can contain the following parts:
The syntax for statechart transitions is as follows:
trigger [guard] /action
The following example shows a transition label consisting of a timeout trigger (see Using timeout triggers), a guard, and an action:
tm(500)[isOk()]/printf("a 0.5 second timeout occurred\n")
In this example, the trigger is the timeout tm(500) and the guard is [isOk()]. The action to be performed if the trigger occurs and the guard is true is printf("a 0.5 second timeout occurred\n").
All three parts of the transition are optional. For example, you can have a transition with only a trigger and an action, or only a guard. The following example shows a transition label consisting of only a trigger and an action:
clockw /itsEngine->GEN(start)
When typing a multiline transition label (for example, one that has several actions separated by semicolons), you can press Ctrl+Enter to advance the cursor to the next line and continue the label.