cancel
Showing results for 
Search instead for 
Did you mean: 

Tasks Assigned

muratto12
Champ in-the-making
Champ in-the-making
Hi,

Is there any way to query only assigned tasks?

It is possible to list only unassigned tasks by this line.

taskService.createTaskQuery().taskUnnassigned().orderByTaskCreateTime().desc().list()

Thanks
4 REPLIES 4

samarjit
Champ in-the-making
Champ in-the-making
I also need a similar criteria query on tasks. It will solve a lot of my queries as other default criteria are fitting my needs.

<code lang="xml">
and RES.ASSIGNEE_ IS NOT NULL
</code>

trademak
Star Contributor
Star Contributor
Hi,

A default use case is to be able to query on tasks with a specific assignee and that's what is supported currently. What's the use case of getting all tasks in the Engine that are assigned? You can also use the NativeTaskQuery to execute your custom SQL statements.

Best regards,

samarjit
Champ in-the-making
Champ in-the-making
Hi,

We are capturing statistics number of tasks assigned vs number of tasks unassigned. I also need some of the variables to show task details. So I am utilizing <code lang="java">includeTaskLocalVariables()</code> and <code lang="java">includeProcessVariables()</code>.
This is the reason why I could not use TaskNativeQuery which does not support fetching of task and process variables.

I am trying not to write queries by hand so that I get the benefit of the complex result mapping done by mybatis in activiti. So far this was the only feature which was blocking.

For the time being I created copies of <code lang="java">Task.xml, TaskQueryImpl.java, TaskQuery.java</code> in my local and added support for <code> and RES.ASSIGNEE_ IS NOT NULL</code>. If I encounter too many changes I will consider writing my own SQL.

-Samarjit

trademak
Star Contributor
Star Contributor
Hi Samarjit,

Why don't you create a pull request with your changes, so we can merge it with master?

Best regards,