cancel
Showing results for 
Search instead for 
Did you mean: 

getting taskAssignee and taskCandidateUser

luisalves00
Champ in-the-making
Champ in-the-making
is it possible to get taskAssignee and taskCandidateUser?

something like this:

tasks = getActivitiEngine().getTaskService().createTaskQuery().taskAssignee(user).taskCandidateUser(user).orderByTaskPriority().asc().list();

then on the inbox have a condition button -> complete (if task.assignee == currentUser) or claim (if task.assignee != currentUser)
5 REPLIES 5

jbarrez
Star Contributor
Star Contributor
Sure that's possible.

But your query will return only the tasks where the user is the assignee AND a candidate user.
So probably you'll need two queries, as we don't support 'or' in the query yet.

luisalves00
Champ in-the-making
Champ in-the-making
tks Smiley Happy

I get it to work before your reply. I make 2 queries and "join" the list.
you should support this case, for developer that don't want 2 inbox (like me).

still need to test this:

Buttons: complete (if task.assignee == currentUser) or claim (if task.assignee != currentUser)

do you suggest a better solution?

jbarrez
Star Contributor
Star Contributor
Nope, that's also how we do it in our webapp.

luisalves00
Champ in-the-making
Champ in-the-making
hi jbarrez,

and how do you orderByPriority and orderByCreateDate after merging the 2 lists?

best regards,
la00

luisalves00
Champ in-the-making
Champ in-the-making
For the ones tha have the same problem when ordering by 2 columns and like SQL found this lib http://josql.sourceforge.net/ that works for me…