Activiti task query with variable result limit

Showing results for 
Search instead for 
Did you mean: 
Active Member II

Activiti task query with variable result limit

Hi Everyone,

I am trying to fetch the all open tasks with variables from activiti engine using task query. I am using version 5.19.0.

I see in TaskEntityManager.findTasksAndVariablesByQueryCriteria(), the max result is limited to 20000.

Even if I try to fetch result in pages, this will still restrict me to 20k. 

Is there any way I can fetch task with variable after 20k record without using native sql.



1 Reply
Senior Member

Re: Activiti task query with variable result limit

Hi vgaur_.

I also encountered the same problem that cannot use sql paging with includeTaskLocalVariables・includeProcessVariables.
I solved this problem by the following pull request. This was merged in Activiti 5.22.0 version.

With includeTaskLocalVariables・includeProcessVariables false, I divided into two queries.
1. First query get tasks.
2. Second query get variables by taskIds().
TaskService.getVariableInstancesLocalByTaskIds(Set<String> taskIds)