Complex approvers list

Colleagues, i have complex approvers dynamic plan. For example - “user-manager” and “somebody from accounting” and “somebody from some business department”. But if somebody reject - process goes to one way, but if we get three approvers - goes to other way.

Hi Mike,

What about this approach?

The approval task assumes two outcomes, approve or reject. Conditional flows route to an error end event. If anyone rejects, then outstanding approvals will be cancelled by the error boundary event…

regards

Rob

hi, good idea.
Maybe even more simple like that.

Ingo

1 Like

Hi Ingo,

Yup I thought of using a conditional…I decided to propose a more explicit approach to start with as conditionals look a little like ‘magic’…

regards

Rob

Hi Rob,

makes sense.

Off topic:
I was not aware of that conditional sequence flow. Interesting method.

Ingo

Thanks. Looks very close to my case. But how i can manage this schema if my number of approvers block dynamic? For example - i know required approvers - manager and purchase manager but number of business unit representative is unknown. In other words - how to build dynamic approver blocks?

Hi @Mike_D,

You can use parallel multiple instance task/activity where collection of approvers is set dynamically somewhere before execution reaches the task/activity.

https://docs.camunda.org/manual/7.10/reference/bpmn20/tasks/task-markers/#multiple-instance

1 Like

Thats looks what i want. Is is possible to setup different approvers for each task instance?

Yes you can…

All you need is to set the process variable with a different set of approvers before execution reaches each task instance.

Do you have some example?

@Mike_D you can implement this by adding service task and configure Java delegate or configure task Listener to the multi instances at event type start.

In the Listener or delegate you have to set like this:

delegateTask.getExecution().setCandidateUsers(usersList);

Or

execution.setCandidateUsers(userList);

It should be collection type.

I’m using rest api with service task and worker.

Simple prototype with javascript that I picked up from the forum.

approve.bpmn (5.0 KB)

3 Likes

I have to deal with same scenario of Multiple Approvers (suppose 5).One may approve/reject. Based on the count (or %age) of Approve/Reject , have to decide next sequence flow.It is a kind of voting we can say.
How can we achieve this?

Any idea on keeping counts of Approve/Reject action on sone join points of parallel gateway or by any other way?