Getting Started with Workflows: Transitions

A transition in a workflow is triggered if a user performs a particular action or a specific event is raised in the code. An event can be raised when some change occurs on the current form to the selected record or on another form to another record.

Transition for an Action

In the following diagram, you can see the steps that the system performs when a user clicks a button or command to invoke an action on the UI of the current form. The system transits the entity to the target state, which can be different depending on the conditions.
Figure 1. Steps in a transition for an action


First, a user clicks a button or command to invoke an action on the form (Item 1 in the diagram). If applicable, the dialog box you have specified for the action is displayed, and the user enters the needed values in this dialog box (Item 2). Then the system updates the fields you have specified based on the values the user has entered in the dialog box for the action (Item 3). Optionally, if the action is defined in a graph, the system applies the parameters that you have specified for the action (Item 4) and invokes the action method (Item 5); only actions defined in a graph can have a method to be invoked and properties to be applied. If you have specified both a transition that the action triggers and a condition for this transition, the condition is then checked (Item 6).

Note: In each transition, you can check for only one condition. To check for multiple conditions, you have to define multiple transitions, one for each condition. The system checks transition conditions in the order in which the transitions are defined on the Workflow (Tree View) or Workflow (Diagram View) page of the Customization Project Editor. Conditions are defined on the Conditions page for the customized screen. For details, see Conditions and Transitions: General Information.

If you have specified the fields to be updated after the transition or the fields to be updated when a record enters or leaves the state, the system proceeds as follows (Item 7):

  1. In the original state, assigns new values to the fields that should be updated when a record exits the state. These new values affect all transitions from this state.
  2. Updates the fields that should be updated after this particular transition. This update affects only this transition.
  3. In the target state, assigns new values to the fields that should be updated when a record enters the state. These new values affect all transitions to this state.

Finally, the system changes the record's state to the target state you have specified for the transition.

Transition for an Event Handler

In the following diagram, you can see the steps that the system performs during a transition to the target state when some change occurs on the current form to the current record or on a different form to another record. This raises an event in the code, which in turn invokes the event handler.
Figure 2. Steps in a transition for an event handler


First, a user invokes an action on the UI of a different form for some other record (Item 1 in the diagram) or changes a value in a box on this form or another form. This triggers an event in the code (Item 2). Then the system invokes an event handler (Item 3) and updates any fields that you have specified for this event handler (Item 4). If you have specified a transition for this event handler and a condition for this transition, the condition is checked (Item 5).

Note: In each transition, you can check for only one condition. To check for multiple conditions, you have to define multiple transitions, one for each condition. The system checks transition conditions in the order in which the transitions are defined on the Workflow (Tree View) or Workflow (Diagram View) page of the Customization Project Editor. Conditions are defined on the Conditions page for the customized screen. For details, see Conditions and Transitions: General Information.

If you have specified the fields to be updated after the transition or the fields to be updated when a record enters or leaves the state, the system proceeds as follows:

  1. In the original state, assigns new values to the fields that should be updated when a record exits the state. These new values affect all transitions from this state.
  2. Updates the fields that should be updated after this particular transition. This update affects only this transition.
  3. In the target state, assigns new values to the fields that should be updated when a record enters the state. These new values affect all transitions to this state.

Finally, the system changes the record's state to the target state you have specified for the transition.