Complex approvers list


#1

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.


#2

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


#3

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

Ingo


#4

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


#5

Hi Rob,

makes sense.

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

Ingo


#6

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?


#7

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


#8

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


#9

Yes you can…

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


#10

Do you have some example?


#11

@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.


#12

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


#13

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

approve.bpmn (5.0 KB)


#14

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?


#15

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