Quorum Approval Process - How to implement?

Hi,
I try to implement a quorum approval process. e.g. 7-out-of-10 approval suffice. I tried several approaches, my last one is this:

What is working:

  • All approval request appear simultaneously in tasklist.

What isn’t working:

  • I would like to evaluate after each approval if there are sufficient votes. If I approve in tasklist one waiting “Approve” task no evaluation of the conditional flow is triggered. Thus my modeling idea fails.

Find my model attached for camunda 7. Take a look at the conditional outgoing flow, I attached a groovy output to check.
quorum-approval-process.bpmn (11.1 KB)

I’m grantful for any hints how to model this process,
Thanks,
Michael

Hello my friend!
Welcome to the forum!

You can, within your multi-instance, create, for example, a process variable called voteCounter, and for each approved vote, you look for the value of this variable, and increase the value.

When exiting your multi-instance, you can create 2 paths, one that directly ends the process if the value of the variable is less than 7, and another that is the happy path, if it is approved.

I believe it can be this way, very easy and simple.

Hope this helps.

William Robert Alves

1 Like

This sounds like a use-case for an Interrupting Conditional Boundary event, along with an event-based subprocess. It might be tricky to diagram it all out with a single process-pool… it might be easier to use a set of messages (one inside the MI-parallel) and one as a Non-Interrupting Event process in the parent process.

@Michael2 part of what you are running into is Process-Instance Scoping issues, which are discussed fairly heavily in “BPMN Method and Style” but the approaches listed in Sliver’s books don’t translate 100% to Camunda.

Hi @Michael2,

Something similar to below model should do the trick. (I am going to share a working example later)
You can define a counter process-instance scoped variable, initialize to 0, add a Task Listener to the “Approve Task”, configure it to get fired on complete event. This Task Listener should do counter’s increment logic. Define your condition for the interrupting conditional event based on the counter’s value.

1 Like

Hi,
it took me some trial, now it is working.


And here the BPMN:
quorum-approval-process02.bpmn (14.3 KB)

Some of my struggles:

  • with the variable mapping in groovy. I could increase “approvalCount” variable for the process-instance.
  • in which scopes I can use “task.” and “execution.”
  • difference between groovy and javascript in scripting

Anyhow, all you tipps helped:

  • Task listener on complete
  • Conditional Broundary
  • early termination as soon as the conditions are met.

Thanks,
Michael

1 Like