Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

BPMN - Wait for an event once

Tags:

bpmn

camunda

I am having trouble modeling one particular use case.

  • Task 1 and Task 2 are spawned in parallel.
  • Task 1 is repeated multiple times based on a condition.
  • Once the first Task 1 is completed, we must wait for Task 2 completion before continuing. Which means first iteration of Task 1 will wait (if Task 2 isn't yet complete), but subsequent iterations will continue since Task 2 is already completed.

Here is my try at modeling:

enter image description here

The issues I see with this model:

1- If Task 2 is completed before the first Task 1 is completed, the Event will be thrown, but not catched. And once Task 1 is complete, it will wait for event indefinitely.

2- On iterations 2+ of Task 1, it will wait indefinitely for the event as it is thrown only once.

Any help on how to model this would be appreciated, thanks !

like image 742
Guillaume Morin Avatar asked Jul 21 '17 18:07

Guillaume Morin


People also ask

How do you use timer events in BPMN?

Open the BPMN process. If you want your process to have a single start event, then you must right-click the start event and select Change Trigger Type and then Timer. If you want your process to have multiple start events, then you must select a timer start event from the Start Events section in the Component Palette.

Can a BPMN model have multiple end timer events?

The BPMN specification allows the use of multiple start or end events at the same process level.

What is intermediate timer event BPMN?

Intermediate Timer Events The BPMN intermediate timer event allows us to either have a process wait explicitly, or have a process react to the passing of time (for example, if someone does not pay a traffic ticket within 30 days, a citation will be issued).

What is a conditional event in BPMN?

Conditional. A conditional intermediate event is an intermediate event with a boolean condition as its trigger. The event triggers further workflow execution when the condition evaluates to true and its outgoing flow is taken. The event must define the Expression property.


2 Answers

You should not use message event. Use conditional event. https://docs.camunda.org/manual/7.6/reference/bpmn20/events/conditional-events/

FYI: I am not familiar with camunda because I am using JBPM. However, for your case it is clear you have to use conditional event.

like image 133
hnandarusdy Avatar answered Sep 24 '22 08:09

hnandarusdy


First off, message events are not suitable for notifying within the same pool. Use signal events instead.

Without understanding the real semantics of task 1 & 2 it is difficult to give a good answer. I'd suggest to unroll the loop and have the first occurrence of task 1 concurrently with task 2, then synchronize with a join and then loop over remaining task 1s.

like image 37
vanto Avatar answered Sep 24 '22 08:09

vanto