State usages can be connected by transition usages, which can activate and deactivate the state usages. The triggering of a transition usage from its source state usage to its target state usage deactivates the source state and activates the target state. The trigger of a transition usage is an accept action usage, which accepts an incoming transfer. Transitions may also have guard conditions and effect actions.

Creating transitions

Creating transitions via the Textual Editor

To create transitions via the Textual Editor


  1. In the Textual Editor, within the body of a state, declare one of the following:

    1. Full transition declaration: 
      1. Declare the transition keyword, specify the element name (optional), follow with the keyword first and the source state name, then the keyword then and the target state name.
    2. Shorthand transition declaration: 
      1. Declare the keyword then followed by the target state name.
        • For shorthand notation, the keyword then must follow after the transition's source state declaration, guard condition, accept action, and effect action.
        • The transition's source state must be a lexically previous state declaration.
  2. Click the Synchronize button.

// ------------ Full transition declaration

state def VehicleStates {
     entry;
     then off;
     state off;
     transition off_to_starting first off then starting;
     state starting;
     transition starting_to_on first starting then on;
     state on;
     transition on_to_off first on then off;    // named transition
     // OR
     transition first on then off;                   // unnamed transition

}

// ------------ Shorthand transition declaration

state def VehicleStates {
      entry;
      then off;
      state off
      then starting;     // this transition's source is the lexically previous state 'off'
      state starting
      then on;             // this transition's source is the lexically previous state 'starting'
      state on
      then off;            // this transition's source is the lexically previous state 'on'
}

Creating transitions via the smart manipulator in a view

To create transitions via the smart manipulator in a view


  1. In a view, select a state symbol, and in its smart manipulator, click the transition command.
  2. Click on the target element. A transition usage is created between the elements.
  3. Specify the transition features.

Creating transitions via the view palette

To create transitions via the view palette


  1. In the view palette, under the States group, click the transition button to create a transition usage.
  2. In a view, click on the source element symbol, then click on the target element symbol. A transition usage is created between the elements.
  3. Specify the transition features.

Specifying transitions

Specifying accepters for transitions via the Textual Editor

A transition usage can also have an accepter, which is an accept action usage used to trigger the transition. It may have payload and receiver parameters, accepting the transfer of a payload received by the given receiver. A payload parameter can also include a feature value to only accept the value that is the result of the feature value expression.

To specify accepters for transitions via the Textual Editor


  1. In the Textual Editor, place the cursor between the transition's source and target, before the guard condition, then declare the accept keyword.

    Transition usages from the entry action are not allowed to have accepters.

  2. Follow the keyword with any of the needed options: 
    1. Specify a payload parameter.
      1. Specify a feature value of a payload parameter:
        1. A change trigger with the keyword when followed by an expression whose result must be a Boolean value.
        2. An absolute time trigger with the keyword at followed by an expression whose result must be a TimeInstantValue.
        3. A relative time trigger with the keyword after followed by an expression whose result must be a DurationValue.
    2. Identify a transfer receiver parameter with the keyword via.

      Accepting context

      • When an accept action usage is a composite feature of a part definition or usage, then the default for the receiver (via) of the accept action usage is the containing part, not the accept action itself. 
      • Otherwise, the accepting context is the highest level containing action usage. 
      • When accepting through a port, the port usage is the receiver (via).
  3. Click the Synchronize button.

transition on_off first on accept TurnOff via commPort then off// unnamed payload parameter with the transfer receiver parameter
transition on_off first on accept turnOff : TurnOff via commPort then off // named payload parameter with the transfer receiver parameter
transition on_off first on accept TurnOff when normalTempmaxTemp then off // change trigger feature value of a payload parameter
transition on_off first on accept TurnOff at maintenanceTime then off // absolute time trigger feature value of a payload parameter
transition on_off first on accept TurnOff after 50 [min] then off // relative time trigger feature value of a payload parameter

Specifying guard conditions for transitions via the Textual Editor

The transition usage can contain a guard condition, which is a Boolean expression that must evaluate to true for the transition to fire. 

To specify guard conditions for transitions via the Textual Editor


  1. In the Textual Editor, place the cursor between the transition's source and target, after the accepter, then declare the needed keyword:

    1. if - the specified guard expression must evaluate to true for the transition to occur.

    2. if not - the specified guard expression must evaluate to false for the transition to occur. 
  2. Follow the keyword with the guard expression.

  3. Click the Synchronize button.

transition init if isInitOff then off // 'if isInitOff' specifies a guard condition which must evaluate to true for the transition to occur
transition init if not isInitOff then on // 'if not isInitOff' specifies a guard condition which must evaluate to false for the transition to occur

Specifying effect actions for transitions via the Textual Editor

A transition usage can have an effect action, which is performed if the transition usage is triggered. An effect action is notated using the keyword do in the same way as a do action on a state definition or usage. 

To specify effect actions for transitions via the Textual Editor


  1. In the Textual Editor, place the cursor between the transition's source and target, after the accepter and guard condition, then declare the do keyword, followed by the needed action.
  2. Click the Synchronize button.

transition off_on first off accept TurnOn via commPort if isEnabled do action powerUp : PowerUp then on;  // action usage as the do effect action 
transition on_off first on accept TurnOn after 5 [s] if isEnabled do send TimeoutSignal() via commPort then off// send action usage as the do send effect action