0
votes

I have a task which can be assigned to Candidate group user's CG1. Now there are 10 user in CG1 but based on few criteria i want to exclude one user of this 10. So the excluded user should not able to see the task when queried for tasks for assignment

I used delegateTask.deleteCandidateUser(userId) on the creation of the task.

But the above did not work. Please advice.

2
Did you try to play with task listeners? The idea is to keep a the group assignment, but attach a listener to the TASK_COMPLETED event where you can do whatever logic you need authorize and throw an Exception if the user is not allowed to do it.This will work as a "last defense" against the completion by an unauthorized group member, and should be complemented by an UI-level logic that would hide/block completion before it happensPhilippe Sevestre

2 Answers

1
votes

Dynamic group assignment is the exact use case for task listeners (assign event). After 15 years in BPM, it is very evident that in all but the most trivial (read demo) cases, task assignment is usually dynamic. While a user may be a member of a single or multiple group, task assignment usually requires filtering beyond the group level (based on shift, geography, certifications or availability). For one project I even created a dynamic task assignment and notification based on a RACI matrix. Activiti's answer to dynamic assignment is the Task Listener.

0
votes

Can you remove the user from the Group? That will be the suggested approach. or create a new group without that user?