Search code examples
javacamundabusiness-process-management

Schedule Camunda Parallel Sub-Processes independently


I'm building a Business Flow for a Task that goes through lots of Review Task between multiple people, until it gets Decided then it needs to go into a decisioned Flow. Try to achieve that on Camunda 7.19 as below.

First A decision Table and a Service Task decides a list of the next Tasks needs to be scheduled (into a list).

enter image description here

Then Perform Next Task is a multi-instance sub-process that schedule those list of Tasks as below enter image description here

Finally once one of those Review-Tasks decides the case, the case should go back up to the parent process & continue on to Decisioned Case Sub-Process.

The Problem... I need the ability to schedule multiple Review Tasks at the same time, however I'm not always able to return to the parent & hit that case decided Gateway because only one of the two tasks scheduled are completed, the other is still scheduled.

Current Behavior

Review Task A (completed [B & C should be next])
   |_ Review Task B (Scheduled)
   |_ Review Task C (Scheduled)

Review Task C (Completes [D should be Next, along with whatever from before])
   |_ Only Review Task B (Scheduled)

Review Task B (Completed [Y should be Next, along with whatever from before])
   |_ Only Task Y (Scheduled)

Review Task Y (Completed with case Decisioned)
   |_ Decisioned Case sub-process Starts

Desired Behavior

Review Task A (completed [B & C should be next])
   |_ Review Task B (Scheduled)
   |_ Review Task C (Scheduled)

Review Task C (Completes [D should be Next, along with whatever from before])
   |_ Review Task B (Scheduled)
   |_ Review Task D (Scheduled)

Review Task B (Completed [Y should be Next, along with whatever from before])
   |_ Review Task D (Scheduled)
   |_ Review Task Y (Scheduled)

Review Task Y (Completed with case Decisioned)
   |_ Review Task D (Canceled)
   |_ Decisioned Case sub-process Starts

The Fact that I'm running two sub-processes & then finishing one and wants it to go back up to the parent and continue the flow, while the other one needs to still be there... is what I can't achieve. Any help or pointers would be much appreciated.


Solution

  • since I also posted this question in Camunda Forums & got lots of suggestions and explaining, I'm leaving the final answer here in case it's needed in the future.

    Eventually below is the process flow modeled as per my requirements and it worked as needed, it achieved the following:

    • parallel sub-process
    • each completed sub-process has it's own flow back to parent
    • once any process completes with a specific condition, all other scheduled processes gets canceled & the parent flow continue in a specific direction

    Camunda forum link enter image description here