03-21-2017 06:59 PM
taskService.createTaskQuery().or().taskUnassigned().taskAssigned(name).endOr().list();
I was just testing the functioning of or(). But it is behaving weird when I try to run above statement it gives me all the task which are assigned to some name and all the unassigned tasks.
But when I try to run the below command it doent give me the desired result. Can someone help me on this.And how should I include AND and OR in the taskQuery
taskService.createTaskQuery().or().taskUnassigned().taskCandidateGroupIn(roles).endOr().list();
03-22-2017 12:12 PM
Kaustubh,
It does not seem appear that .taskAssigned(name) is a valid API to call; it appears that what you're looking for, in order for the first query to work is taskCandidateOrAssigned - which selects tasks that have been claimed or assigned to user or waiting to be claimed by user.
The way you're utilizing .or() / .endOr() is correct; .or() is the opening for things that you're trying to or together, and .endOr() is how you close that list.
For your query:
TaskUnassigned should cover all tasks that aren't assigned or claimed. And TaskCandidateGroupIn will return tasks for which the 'candidateGroup' is one of the given groups (or as you've labeled it, 'roles').
What result does it give you?
-JEarles
Explore our Alfresco products with the links below. Use labels to filter content by product module.