Summary
#7175 (#7141) moved the Inbox's subject variables onto the task query (findTasksWithProcessVariables + includeProcessVariables()), removing the one variable read per task. The new javadoc in BpmInboxEndpoint.mapToDTOs (lines 64-67) and in TaskServiceImpl.findTasks(type, boolean) (line 247) now claims the listing is "one statement". It is not: mapToDTO still runs two more queries per task.
components/engine/engine-bpm-flowable/src/main/java/org/eclipse/dirigible/components/engine/bpm/flowable/endpoint/BpmInboxEndpoint.java:
List<IdentityLink> identityLinks = bpmService.getTaskIdentityLinks(task.getId()); // line 90
...
ProcessInstanceData processInstance = bpmService.getProcessInstanceById(task.getProcessInstanceId()); // line 107
getTaskIdentityLinks runs validateTask(taskId) + getIdentityLinksForTask (TaskServiceImpl.java:276-280, two statements); getProcessInstanceById runs a ProcessInstanceQuery (BpmService.java:320-323 -> BpmProviderFlowable.getProcessInstance). With the store polling ?type=assignee&limit=100 and ?type=groups every 30 s and on every route change, a 100-task inbox is still roughly 300 statements per poll - #7175 removed about a quarter of the #7141 problem and documented it as solved.
Fix
getProcessInstanceById is keyed by processInstanceId, which many tasks share: dedupe per listing with the same computeIfAbsent pattern labelKeys already uses (line 115), or ride it on the task query (includeProcessVariables already brings the instance's variables; the business key / definition id are on the task).
- Identity links: Flowable's
TaskQuery cannot include them, but IdentityLinkService/taskInvolvedUser filters or one HistoricIdentityLinkQuery over the listing's task ids replace 100 validate+query pairs with one statement.
- Fix the two javadoc claims either way.
Found reviewing #7175.
Summary
#7175 (#7141) moved the Inbox's subject variables onto the task query (
findTasksWithProcessVariables+includeProcessVariables()), removing the one variable read per task. The new javadoc inBpmInboxEndpoint.mapToDTOs(lines 64-67) and inTaskServiceImpl.findTasks(type, boolean)(line 247) now claims the listing is "one statement". It is not:mapToDTOstill runs two more queries per task.components/engine/engine-bpm-flowable/src/main/java/org/eclipse/dirigible/components/engine/bpm/flowable/endpoint/BpmInboxEndpoint.java:getTaskIdentityLinksrunsvalidateTask(taskId)+getIdentityLinksForTask(TaskServiceImpl.java:276-280, two statements);getProcessInstanceByIdruns aProcessInstanceQuery(BpmService.java:320-323->BpmProviderFlowable.getProcessInstance). With the store polling?type=assignee&limit=100and?type=groupsevery 30 s and on every route change, a 100-task inbox is still roughly 300 statements per poll - #7175 removed about a quarter of the #7141 problem and documented it as solved.Fix
getProcessInstanceByIdis keyed byprocessInstanceId, which many tasks share: dedupe per listing with the samecomputeIfAbsentpatternlabelKeysalready uses (line 115), or ride it on the task query (includeProcessVariablesalready brings the instance's variables; the business key / definition id are on the task).TaskQuerycannot include them, butIdentityLinkService/taskInvolvedUserfilters or oneHistoricIdentityLinkQueryover the listing's task ids replace 100 validate+query pairs with one statement.Found reviewing #7175.