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:
-
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
orstep
.Example:
$.get('uid') || process.get('myDataProvider.uid')
- Click (Add).
-
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
- 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
$.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.
$.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>'
.
Action Template: Command
Command: Proceed.ButtonA
$.get('command') == 'Proceed.ButtonA'