Camunda:exclusive attribute not present in bpmn xml when camunda:asyncBefore="true"

When i mark activity(Task A) as camunda:asyncBefore=“true” then by default Exclusive is pre-selected. But in the bpmn xml camunda:exclusive=“true” property is not found.

<bpmn:serviceTask id="Task_0w10zbj" name="Task A" camunda:asyncBefore="true">
   <bpmn:incoming>SequenceFlow_0yl1fdl</bpmn:incoming>
   <bpmn:outgoing>SequenceFlow_1xgvk8d</bpmn:outgoing>
</bpmn:serviceTask>

When i mark activity(Task A) as camunda:asyncBefore=“true” then by default Exclusive is pre-selected. Then i unchecked the Exclusive property, now in the bpmn xml camunda:exclusive=“false” property is found.

<bpmn:serviceTask id="Task_0w10zbj" name="Task A" camunda:asyncBefore="true" camunda:exclusive="false">
   <bpmn:incoming>SequenceFlow_0yl1fdl</bpmn:incoming>
   <bpmn:outgoing>SequenceFlow_1xgvk8d</bpmn:outgoing>
</bpmn:serviceTask>

So by default the engine will treat camunda:exclusive=“true” when camunda:asyncBefore=“true” was enabled, unless if we explicitly set camunda:exclusive=“false” ?

@aravindhrs Yes, exclusive is the default. It’s described in this way in the docs:

However, while this is a perfectly fine solution from the point of view of persistence and consistency, this might not always be desirable behavior at a higher level, especially if the execution has non-transactional side effects, which will not be rolled back by the failing transaction. For instance, if the book concert tickets service does not share the same transaction as the process engine, we might book multiple tickets if we retry the job. That is why jobs of the same process instance are processed exclusively by default.

The basic idea I believe is that exclusive jobs are the safer option to default to because they prevent potentially confusing (although technical mostly innocuous) optimistic locks when synchronising parallel executions and thereby prevent issues with executions that are not idempotent.

This is backed up by what’s visible in the code base. In AcquirableJobEntity, the base class for jobs, you’ll see this for example:
protected boolean isExclusive = DEFAULT_EXCLUSIVE;

And the default in the same class is true.

@tiesebarrell thanks :slight_smile:

:slight_smile::+1:t2: