SetDefaultValuesTask
Introduction
The SetDefaultValuesTask reads the BPMN XML and sets the default values of form fields as variables on the execution context if not already present.
It reads the form fields on the start event of the current process definition and for every field it checks:
-
if a default value is specified
-
if no variable is set with the ID of the form field
If both conditions are false this task will set the variable to the default value specified.
Usage
Declare all your workflow input parameters as form fields on the start event of the BPMN. Then set appropriate default values wherever possible and set the DefaultValuesTask as Start-Listener.
It is recommended to not use asynchronous continuation on the start event to provide immediate feedback to the user via red toaster in UI: