A transition has the form:

transition trigger: someTrigger guard: booleanExpression do: actions next state: stateName

The parts trigger:, guard:, do: are optional. The "next state:" part must be present, except in an "in all states" construction.

To express non-determinism, e.g., because the response to a trigger depends on internal state information, the OR construct can be used. For instance:

transition trigger: PowerOn
   do: reply(Status::OnOK)      next state: SwitchingOn
   OR
   do: reply(Status::OnFailed)  next state: Off

An example of a state with transitions:

state on {
   transition
       trigger: CurrentTemp(Status st, string info, bool error)
       guard: 12.0 < temp AND temp < 34.7
       do: localstat := st
       reply(temp)
       next state: on

   transition
       guard: code == 3
       do: myMode(Mode::on)
       next state: on
}

If the trigger of a transition is a command that has inout or out parameters, their values should be given in the reply in the following order:

For example, assume a command defined in a signature file:

commands
bool doSomething(int input, out int r)

The reply in a transition shall be:

 transition trigger: doSomething(int input, int r)
 do:
 ...
 reply(2, true)

In this example, true is the return value of the command, 2 is the value of the out parameter r.

In the body of transitions, out parameters are write-only, that is, they can only be assigned with values but their value cannot be read in an expression.

The special value any (*) can be used in reply for inout and out parameters. If an out parameter is not explicitly assigned with a value in a transition body then the default value of the corresponding type will be used.