How to access the previous task assignee(user or group) in the subsequent Service Task?

cancel
Showing results for 
Search instead for 
Did you mean: 
paiyyavj13
Established Member II

How to access the previous task assignee(user or group) in the subsequent Service Task?

Jump to solution

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.

1 Solution

Accepted Solutions
paiyyavj13
Established Member II

Re: How to access the previous task assignee(user or group) in the subsequent Service Task?

Jump 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...! Smiley Happy

View solution in original post

1 Reply
paiyyavj13
Established Member II

Re: How to access the previous task assignee(user or group) in the subsequent Service Task?

Jump 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...! Smiley Happy