Guillaume Morin
Guillaume Morin

Reputation: 4010

Bpmn - How to model an optional task

enter image description here

After the Task 1 is completed, we need to spawn an optional task, based on a condition. The process completion does not depend on this optional task completion.

What is the correct way to design this model ?

Upvotes: 11

Views: 19643

Answers (4)

R TheWriter
R TheWriter

Reputation: 163

Are conditional markers BPMN 2.0 ok? not even seen them before except they remind me good old UML.

I think this should be solved using a XOR gateway.

enter image description here

Upvotes: 0

hnandarusdy
hnandarusdy

Reputation: 452

Using non-interrupting (message/signal/escalation) events will help your scenario.

Alternatively, using event subprocess in this process.

Let me know if you understand how to use it. Otherwise, I will draw an example for you

UPDATE

NOTE: 1. I am only using bpmn.io to draw example instead of Camunda. However, this is basic BPMN and I assume Camunda must have this type of model. I am only familiar with JBPM.

EXPLANATION: Basically, you don't really have to use message event. It can be signal/escalation depending on what scenarios you have. Theoretically, message event is used if there is an incoming message to create other activities and this event is the most common among the others. Yet, one thing you must consider is whether the event is interrupting or not. In your case, it doesn't interrupt, therefore I put non-interrupt message event.

Interrupt message event will abort the Task 1 immediately as soon as the event is triggered while non-interrupting is only adding additional task/event without aborting Task 1.

enter image description here

Hope this example helps.

Upvotes: 0

Patrick Werner
Patrick Werner

Reputation: 1115

the desired behaviour can be modeled like this:

BPMN Diagram

After Task1 completes Task2 is triggered, if the optional Condition is true, the optional Task is triggered as well. The Instance is terminated after Task2 is finished. If the optional Task was still active it will be terminated.

Upvotes: 6

VivekRatanSinha
VivekRatanSinha

Reputation: 616

Modeling optional task in BPMN

You should use conditional marker for the optional flow. Exclusive gateway in your diagram will always execute mandatory Task 2, optional task will always be ignored even when the condition for its execution is true.

Parallel gateway can not be used as it will wait for the optional task to complete for successful merge.

Upvotes: 2

Related Questions