cancel
Showing results for 
Search instead for 
Did you mean: 

How do you query for completed tasks

srobinson
Champ in-the-making
Champ in-the-making
I am trying to query for completed tasks and I can't find a way to do it through the TaskQueryService and I do not know the database tables well enough to use native query.  Can anyone lend a hand as to where the task "status" is kept and how to query for this?  I am using Activiti 5.7.

Also, is there a way to do an exclusion query in the TaskQueryService?  For example, how do I query for all tasks with a name NOT equal to "Review Task".

Thanks,

- Shannon
2 REPLIES 2

frederikherema1
Star Contributor
Star Contributor
As soon as a Task is completed, it's removed from the task-table (the RU in the ACT_RU_TASK table name, stands for runtime). If your history-level is configured correctly (see user guide), the task will be present in the ACT_HI_TASKINST table, query able using historyService.createHistoricTaskQuery().

srobinson
Champ in-the-making
Champ in-the-making
Great … that helps clears things up a bit!

- Shannon