Task assigngment queries

I have couple of questions regarding task assignment. In our workflow, there can be task which should be assigned to:

  1. All users in system
  2. All users except an user who trigerred the workflow ($createdBy is the variable in workflow).

How can I set the assignee field for above 2 use cases?

Output:
In case 1: any one who logs in should see the task assigned to him.
In case 2: any one except $createdBy should see the task when he logs in.

when user logs in, we are getting the task assigned to user by rest api call. (/task?assignee=user-1)

By setting camunda:candidateUsers attribute will allow the users to access the tasks which they are authorised to work.

<bpmn:userTask id="Activity_155cewx" camunda:candidateUsers="${candidateUserList}">
   <bpmn:incoming>Flow_18f4ni2</bpmn:incoming>
</bpmn:userTask>

Follow the above same approach and additionally, add the task listener to the user task to exclude the created user if all the users belong to the same group.

for case 1:
what is candidateUserList ? We have about 1 million users in our system. Do we pass all the id’s as array in the list?

Any suggestions?

@Rohit_Singh if the users are many, then you can use candidateGroups

Hi @aravindhrs But that would require me to add all users in a group, right?

Also, we don’t maintain users in camunda database. In camunda, we just pass id’s. For example if we need to assign a task to group-1 we just set assignee=group-1 in camunda. In our system, if someone logs in from group-1 we call camunda’s rest-api with /task?assignee=group-1 and get the task. Do you see a problem with the approach?