Dispatching

Learn to define rules for steps using Dispatching.

In the Dispatching section of the step definition you define rules for the next step to be executed. For further details, see Defining Dispatching Rules.

The conditions defined here are checked one after the other. The step associated with the first condition that evaluates to true is executed.

To reorder the dispatching rules, click (Drag&Drop) in the respective row and drag it to the desired position.

Dispatching rules can be based on

  • a method, e.g. process.isSubStep()
  • any condition, e.g. a specific record must be available: !!$.get('companyUid')
  • a command, i.e. the user selects a record or clicks a button in the page header or a button, record or link on a Process Ask page. For further details, see Dispatching Based on Commands.

Defining Dispatching Rules

To define a dispatching rule and next step:

  1. Condition: Enter a JavaScript expression to be evaluated. If there is only one possible next step, just enter "true".

    If your condition requires values from multiple data providers, you can access these values using the predefined variables process or step.

    Example: $.get('uid') || process.get('myDataProvider.uid')

  2. Click (Add).
  3. Source: Select the data provider containing the values used by the condition. Available data providers:
    • Constant Value
    • Process Storage
    • Input Message
    • Step: For commands you must always select "Step".
    • custom data providers
  4. Next Step: Select or create the step to be called if the dispatching condition is met. For further details, see Defining Steps.

Dispatching Based on Commands

To define a dispatching rule for default commands use the following syntax (Condition):
$.get('command') == 'Select'
$.get('command') == 'Save'
$.get('command') == 'New'
$.get('command') == 'CancelProcess'
etc.

If you use a form with a RecordListBox widget in a process, use the command property of the widget: command = Proceed<...> calls the next step.

For buttons, records or links on a Process Ask page you need to enter an Event No. in the Process Ask Configuration. In the dispatching definition these events are referenced as
$.get('command')=='Event1'
$.get('command')=='Event2'

If you want to use custom buttons in a process, you need to use the proceed method, i.e. the command for the button must follow the naming convention 'Proceed<Name>'.

Button definition:
Action Template: Command
Command: Proceed.ButtonA
Dispatching condition:
$.get('command') == 'Proceed.ButtonA'