Conditional User Task

I have a scenario where 2 user tasks need to created in parallel but it can so happen that based on each value it will be created. for Ex, #{value1 == true} and #{value2==true}. so sometimes value1 can be true, value2 can be true or both can be true and both can be false. so I need to handle this scenario. Please help me.
Note - In IBM BPM we have this conditional activity where we can provide a condition for a user task to get invoked even though the flow line is followed.

Hi @syedkp and welcome,

You have different options. The most straightforward one is an inclusive gateway:


Due to a limitation in Camunda, this may not work if the part between the opening and closing gateway is very complex. Furthermore, inclusive gateways are error-prone from my experience. So, I’d recommend the following solution:

You can use a parallel gateway with subsequent exclusive gateways:


This variant has two advantages:

  • First, it is very clear that the two activities can be skipped
  • Second, you can execute additional activities on each of the branches even if the activities get skipped.

I hope that this helps.

3 Likes

Thanks Stephan for your solutioning and quick reply. 2nd option makes sense and looks clearer. Any idea why we don’t have a condition on the user task like other BPM tools, it would have made life easier. Sorry I am new here and not sure if its already been discussed.

There is no “conditional user task” in Camunda because there is no “conditional user task” in BPMN. Camunda aims to comply to the standard.
I assume the standard wants to make the routing of the process clear: If there is an activity on the chosen path, it must be executed. The only exception is racing conditions that may occur due to boundary events or event-based gateways. They can disable or interrupt a task. You can read more about the execution semantics of activities in the BPMN Standard, Chapter 13.3.2, p. 428 or in the Camunda Docs.

1 Like

okay sure. Thanks once again.