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).
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 part & 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 & continue whenever the human task is completed… is what I can’t seem to achieve.
Any Help or pointers would be much appreciated… sorry for the long post
If I have understood your requirement correctly, the below solution might work.
With the help of non-interrupting message boundary event, you can capture the message and go back to the parent while one of the multi instance sub-process(Review Task) is in progress and trigger the next review task. You can repeat the same until you achieve completing all your review tasks.
If I understand you requirement correctly, I think there is one small point missing from the previous solution. I understood that all open tasks should be cancelled if a reviewer decides the case and no further reviews are needed.
That could be done by changing the scope to a transactional scope and using the cancel end event.
What I don’t completely like about this model is, that the “normal” flow would be the one, where all tasks are reviewed, no further tasks exist and still no decision was reached.
But currently I cannot think of a better way to model this scenario.
trying correlation.processInstanceId(caseInstanceId).correlateWithResult(); is giving a MismatchingMessageCorrelationException No process definition or execution matches the parameters
trying correlation.correlateAllWithResult(); is giving a null result
I believe that because your “send message” is a “FINAL” event, at the same time that it makes the call to your message boundary event, your instance has already left the subprocess, and that is why you are receiving this mismatching.
The mismatchingCorrelationException happens when Camunda does not find any instance in the scope to receive that correlated message… or when the correlation message does not exist / has not been configured.
I believe that if you put a message intermediate throw event and then an end event, your instance will not have gone out of scope by the time the correlate is fired, and it will work fine!
Interesting point @GotnOGuts I wasn’t aware of that & thanks @WilliamR.Alves for the suggestion I will try to implement & will update here in a day or so.
thank you so much for your efforts, much appretiated.
Thanks to everyone who helped with suggestions on this question, I was finally able to get the process modeled as I wanted to using the escalation events inside a parallel sub-process as suggested by @WilliamR.Alves & @rohwerj
In case someone in the future needs the full process to take a look…