10-25-2017 11:56 AM
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.
10-25-2017 02:11 PM
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...!
10-25-2017 02:11 PM
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...!
Explore our Alfresco products with the links below. Use labels to filter content by product module.