<< Click to Display Table of Contents >> Execution of automatic tasks in sequence |
Overview
In Bizagi multiple sub-processes can also be executed as an asynchronous activity. See Launch multiple instances asynchronously. However, you need to keep in mind best practices when you run sequences or a combination of asynchronous activities with asynchronous sub-processes. This section explains recommendations when you execute a series of activities in sequence.
Execution of activities in sequence
When you model a sequence of activities like service tasks or multiple sub-processes configured as synchronous, Bizagi executes all the tasks in the same transaction.
This is NOT a recommended practice. We recommend using asynchronous behaviors. |
For multiple sub-process, cases are created synchronously and treated under the same transaction, unless there is an asynchronous element within the sub-process. In case of an error, Bizagi will do a rollback to the beginning of the transaction. Bear in mind that, when you have a long set of synchronous executions, you can potentially slow down the system due to a high amount of resources that must be executed in one big transaction.
To avoid this, evaluate for each task if it should be:
a. An asynchronous task
b. A script task with an onExit or an onEnter expression.
Consider that some service on synchronous tasks will need to be run again. |
If you want to keep the full rollback until the case start, then option b is the best choice. That way less database entries will be created (tables related to asynchronous tasks). |
Asynchronous execution as best practice
In this scenario is best practice to set each execution for both service tasks and multiple sub-processes using the asynchronous property. This property lets Bizagi run each task separately (in single transactions), instead of running a long transaction.
Asynchronous activities with the show feedback disabled, and retries, are executed by the Scheduler.
When you have various asynchronous activities combined in sequence with other BPMN elements, the transaction of the async task extends the execution of other elements until it finds any of the following elements:
•Timer.
•End event.
•Convergent gateway as synchronization and the condition is not met yet.
•User or manual task /event.
•Another asynchronous task.
For example, when an asynchronous activity starts its execution by the Scheduler, the same transaction continues until it finds any of the elements previously mentioned.
This is very important to consider when you define the Asynchronous activity timeout because, if there are other elements executed in sequence, this can affect the response time of the asynchronous activity. The best practice is to avoid long-running transactions by converting as many automatic tasks as possible to asynchronous activities.
Last Updated 7/5/2023 10:56:54 AM