Hi,
I have a requirement when the task is about to be due send an email notification to the user or group Assignee.
The way I go about is store the taskId of the- about to be due task in an execution variable and retrieve the task in the subsequent Service task using below piece of code in my JavaDelegate Class:
String dueTaskId = (String) execution.getVariable("dueTaskId");
Then I get the Task using below:
Task appTask = taskService.createTaskQuery().taskId(dueTaskId).singleResult();
Now from the above appTask variable I can get the assignee using: appTask.getAssignee();
I believe this gives me the USER the task is assigned to and not the GROUP, if the task was not yet claimed.
What if I need to get the group the task was assigned to? a scenario where the task is yet to be claimed?
I noticed that if I manage to get the DelegateTask object for the relevant taskId(instead of the Task object as mentioned above in my code), then I can manage to get the assigned group by using- delegateTask.getCandidates();
Any inputs would be appreciated.... Thank you in advance...
Regards.
Solved! Go to Solution.
I digged a bit deep and noticed that I could use taskService.getIdentityLinksForTask() to get the group info that I needed from within the JavaDelegate Class I was in.
This works for me...!
I digged a bit deep and noticed that I could use taskService.getIdentityLinksForTask() to get the group info that I needed from within the JavaDelegate Class I was in.
This works for me...!
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.