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.
Solved! Go to Solution.
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);
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.
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".
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)
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);
bundle of thanks brother, pretty much clear
Hello Bassam Al-Sarori Even I have the same case. can you post your working code it will be help full.
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.