06-05-2018 01:11 PM
Scenario is Task A submitted by User A navigates to Task B assigned to User B, how can I set User A as viewer (which can monitor) of Task B whose assignee is User B.
I tried Candidate user in this case but not working as Candidate User has to Claim the task but in my case task is already assigned to another user.
next point will be Can a user Group be viewer just like we have User A for Task B???
answer with example will be highly appreciated.
06-07-2018 08:25 AM
There is no harm of involving a user as a candidate. To add a user as a participant use the TaskService addUserIdentityLink method TaskService (Activiti - Engine 5.22.0 API)
taskService.addUserIdentityLink("1001", "kermit", IdentityLinkType.PARTICIPANT);
06-06-2018 06:05 AM
I got the solution for my first question how User-A can watch task which is assigned to user B, User A could be
activiti:candidateUsers="${User-A}" in respective task definition whereas
//Java Code
List<Task> involvedTaskList = taskService.createTaskQuery().taskInvolvedUser("User-A").list();
this list returns all the tasks in which User-A is involved (either assigned or Candidate)
now
task.getAssignee()
gives me difference in the tasks assigned to User-A and task in which he is Candidate.
I will post my second answer once i will get solution.
06-06-2018 08:10 AM
You can involve the user to the task. "candidate" is a special type of involvement which allows the user to claim the task. But you can involve the user as a "participant".
06-06-2018 02:29 PM
thanks Bassam, couple of clarifications required
1. what is harm if I move forward with Candidate User and get involved tasks no matter I will not claim them
2. can you please give example how to add user as a participant in task (java code)
06-07-2018 08:25 AM
There is no harm of involving a user as a candidate. To add a user as a participant use the TaskService addUserIdentityLink method TaskService (Activiti - Engine 5.22.0 API)
taskService.addUserIdentityLink("1001", "kermit", IdentityLinkType.PARTICIPANT);
06-09-2018 03:17 PM
bundle of thanks brother, pretty much clear
06-21-2018 02:04 AM
Hello Bassam Al-Sarori Even I have the same case. can you post your working code it will be help full.
Explore our Alfresco products with the links below. Use labels to filter content by product module.