Skip to main content
Version: 6.18

Asynchronous activities and event triggers (#669155, #669250)

It is now possible to configure activities and business event triggers for asynchronous execution. Asynchronous processing can be used to mitigate the effects of long-running scripts executed in the scope of workflow activities or business event triggers. It improves the user experience as the Web Client is not blocked during the execution and the user can continue working normally.

Web Admin Suite changes​

The Workflows page has been extended with settings to configure asynchronous activities and event triggers.

Activities​

The following settings have been added for activities, reopens, jump nodes and end nodes:

  • Execute asynchronously: Select this checkbox if part of the activity's logic should be executed in an asynchronous task script.
  • Asynchronous script: The user can select a script of the type Task which should be executed after the activity is clicked.
  • Execution timeout (seconds): Optional. The user can provide the desired execution timeout for processing the task. If nothing is set, the system's global transaction timeout is used.

Asynchronous activities have an hourglass icon to locate them more easily:

669155-Activity.png

The selected task script is executed after the execution of the element. From the transaction point of view, it's not tied to the activity anymore. Therefore, if the tasks fails, the main transaction is not rolled back automatically. This needs to be considered when designing the business process.

You can pass context information from the activity script to the task by using the new method workflowApi.setAsyncContextData.

Business event triggers​

The following settings have been added for business event triggers:

  • Asynchronous execution: Select this checkbox if the business event trigger should be executed asynchronously. No further settings required.

Asynchronous business event triggers have a dotted line to distinguish them from the regular ones:

669155-BET.png

The system property workflow.asyncBusinessEvent.txTimeout.seconds has been added to the module cmas-core-server. It determines the execution timeout for all asynchronous business event triggers for a case.

Asynchronous business event triggers are executed after the transaction which changed data which the trigger is listening for has been committed.

Web Client changes​

The Web Client displays a yellow progress bar on the case page while an asynchronous activity is still running in the background. Once the activity has finished, the color changes to green.

The users can work normally while the progress bar is shown, i.e. they can continue working on the case or switch to other pages. The progress bar will be shown for the case until the background processing finished.