I got a question for a requirement I’m trying to satisfy in Camunda.
We have a standard workflow called “Signature” that we implement as a workflow we can call using a Call Activity.
We need to give users a way to call multiple signatures, with different people needing to sign. If everyone accepts, workflow ends with an acceptance outcome, if one rejects, workflow ends with a rejection outcome.
Current solution we have does not really keep track has the problem that, whenever we unit test it to see if the process instance has ended or is still active, we always get the following error:
org.camunda.bpm.engine.ProcessEngineException: Query return 2 results instead of max 1
Here’s one of the solutions we thought about that are still not ok:
I’d appreciate your help on this, thanks a lot!
I’m uncertain whether I understood your process and your requirements correctly.
In your model, many tokens are produced and there is no proper synchronization; I understand that that is the reason for using the termination event.
I’d suggest a different approach:
- I would design the signature process to handle a single signature in a straight-forwardly. The process would start, inform the respective person, wait for their response (signature or rejection) and terminate. If the response is a rejection, I’d raise a BPMN error to abort other instances.
- I would call this process from a multi-instance call activity. So that we can instantiate the process for each required signature. The multi-instance call activity has a boundary event that listens for the BPMN error “signature rejected” - it would abort all running instances.
You do not need to care about the synchronization manually — the process engine is doing the work for you.
If this proposal does not solve your problem, please detail your requirements.