Search code examples
bpmncamunda

BPMN - Wait for an event once


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 !


Solution

  • 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.