Error may exist in org/flowable/task/service/db/mapping/entity/Task.xml ORA-01795: maximum number of expressions in a list is 1000

Hi,
I am using flowable 6.6.0 and when we run a particular flow which may have good amount of data. the flow doesn’t get completed and in between starts giving the below error pop ups.

Error querying database. Cause: java.sql.SQLSyntaxErrorException: ORA-01795: maximum number of expressions in a list is 1000

The error may exist in org/flowable/task/service/db/mapping/entity/Task.xml

The error may involve org.flowable.task.service.impl.persistence.entity.TaskEntityImpl.selectTasksWithRelatedEntitiesByQueryCriteria-Inline

The error occurred while setting parameters

SQL: select * from ( select a., ROWNUM rnum from ( select RES., VAR.ID_ as VAR_ID_, VAR.NAME_ as VAR_NAME_, VAR.TYPE_ as VAR_TYPE_,
VAR.REV_ as VAR_REV_, VAR.PROC_INST_ID_ as VAR_PROC_INST_ID_, VAR.EXECUTION_ID_ as VAR_EXECUTION_ID_, VAR.TASK_ID_ as VAR_TASK_ID_,
VAR.BYTEARRAY_ID_ as VAR_BYTEARRAY_ID_, VAR.DOUBLE_ as VAR_DOUBLE_, VAR.TEXT_ as VAR_TEXT_, VAR.TEXT2_ as VAR_TEXT2_, VAR.LONG_ as VAR_LONG_
from ACT_RU_TASK RES left outer join ACT_RU_VARIABLE VAR ON RES.ID_ = VAR.TASK_ID_
WHERE RES.PROC_INST_ID_ IN
and RES.SUSPENSION_STATE_ = 1 order by RES.ID_ asc ) a where ROWNUM < ?) where rnum >= ?

Cause: java.sql.SQLSyntaxErrorException: ORA-01795: maximum number of expressions in a list is 1000

] with root cause

I think the pagination logic is missing. one of the many places which i found is below code in Task.xml:

and RES.PROC_INST_ID_ IN #{processInstance}

Here the case is not handled if the RES.PROC_INST_ID is more than 1000 count? This is present in Task.xml.

I request you to please comment on this?
@martin.grofcik : Can you share your thoughts on this one?

and processInstance.size() > 1000

=> problem in the app. (misusage of in clause)

Any idea how to resolve this one? Or will we have a fix for this?

Redesign your app.

Martin