AnsweredAssumed Answered

Task Instance Count Wrong Result

Question asked by doganmesut on Aug 3, 2016
Latest reply on Aug 10, 2016 by trademak
Hi  friends,
We are facing an issue  while querying number of historic task instaces.
A piece of code block for example  :

List list = historyService.createHistoricTaskInstanceQuery()
                    .taskAssignee(candidateOrAssignedUser.toString()).taskDeleteReason("completed").finished().list();
int count = list.size();

if we want to get size of list , result is expected but list.size() is useless for us because of performance issue.
We want to use count() method instead of list() method, like below :

int count = historyService.createHistoricTaskInstanceQuery()
                    .taskAssignee(candidateOrAssignedUser.toString()).taskDeleteReason("completed").finished().count();

But these two approaches doesnt match and there is a huge difference. For example list.size() returns 195 results and count() return 425 results.
I will be glad if aynone helps me .
Thank you very much.

PS : Please also note that this situation is the same for querying running task inctances.

Outcomes