Hello, we are running into an invalid state when using a multibody instance wrapper around a task that is to be performed by each user.
In particular, our setup is that each recipient will enter a subprocess. Inside of this subprocess, the user must complete a task by doing a user-related task in our application. Once the task is completed, the sub-process for that recipient is moved into an end-of-process state.
Additionally, we allow the initiator of the task to cancel an individual assignee’s sub-task, for the task might no longer be valid for that individual recipient.
To do this, we tried leveraging the cancel task process instance modification for an individual recipient. This typically seems to handle the canceling of the task in an effective manner, however there is one bug with this: if the last recipient is canceled, the multibody instance never completes.
To summarize, let’s assume we have two recipients, A and B.
If A completes the task, and then B completes the task, then the multibody instance step is completed and it moves on.
If A cancels the task, and then B completes the task, the multibody instance step is also completed and it moves on.
If A cancels the task, and then B cancels the task, then the entire process instance is marked as canceled.
Lastly (the bug), if A completes the task and then B cancels the task, the process instance is left in an invalid state, and the Camunda cockpit shows as the multibody instance as being active, even though there are no more recipients.
How can I go about correcting this state? Also, I’m using the rest api for this, but I’m comfortable using it and just need an overview of what we should do in this situation. I’m sure the answer involves using the process instance modify command, but I’m not quite sure how.
Thanks for your help!
BPMN Diagram: