Tuesday, June 20, 2023

Camunda Conditional flow behavior in Camunda External Task

 In Camunda BPM, a conditional flow with an external task does not wait for the external task to finish before evaluating the condition. This behavior is by design and is important to understand in order to model your processes correctly.

Here's an explanation of how the conditional flow with an external task works:


Process Execution Reaches the Conditional Flow with External Task: During the execution of a process instance, when it reaches a conditional flow with an external task, the execution pauses at that point.


External Task Creation: Camunda creates an external task and sends it to an external task worker or a specific external system for processing. The external task represents a unit of work that needs to be performed externally.


External Task Execution: The external system or external task worker performs the required work associated with the external task. This work can involve interacting with external systems, performing calculations, or any other business logic specific to your use case.


External Task Completion: Once the external task is completed by the external system or task worker, the result is reported back to Camunda.


Condition Evaluation: After the external task is completed, Camunda evaluates the condition associated with the conditional flow. The condition could be expressed using Camunda's Expression Language or a script. The condition determines which outgoing path the process should take based on the result of the external task or other process variables.


Next Path Determination: Based on the evaluation of the condition, Camunda determines the next path to be taken in the process. If the condition evaluates to true, the process follows the outgoing path connected to the conditional flow with a "true" condition. If the condition evaluates to false, the process follows the outgoing path connected to the conditional flow with a "false" condition.


As you can see, the evaluation of the condition happens after the external task is completed. This means that the outcome of the external task can be considered in the condition evaluation, but the process does not wait for the external task to finish before evaluating the condition.

No comments:

Post a Comment