Description of problem: Java API and Java Remote API don't have full ability to paginate queries. For example I am not able to say how many process instances I want to get when I request all of them via kieSession.getProcessInstances() or auditService.findProcessInstances(). I know this might be complicated to change interfaces TaskService, KieSession, and AuditLogService but it is not efficient to get all the tasks/process instances at once. Maybe for KieSession it is not necessary to add pagination since all the information are already in memory. In TaskService I found only one method where it is possible to paginate results: List<TaskSummary> getTasksAssignedAsPotentialOwner(String userId, List<String> groupIds, String language, int firstResult, int maxResults); And auditing lack this functionality according to the connected JIRA JBPM-4151. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
Please note that ksession.getProcessInstances() will only return the active processes "in the session", when using persistence process instances are stored in the db and released, so in that case this operation will return an empty list. I don't think it's therefore necessary to add pagination operations for that method. For task and audit log etc. they do make sense, we will consider adding them to the (internal) interfaces (at least), and/or as params to the remote operations.
Marco Rietveld <marco.rietveld> updated the status of jira JBPM-4151 to Closed
This has been done as part of the new rich query functionality. Please see the ../rest/query/runtime/process functionality. TEMPORARY documentation can be found here: https://github.com/mrietveld/droolsjbpm-integration/wiki/jBPM-Rest-Query-API
Verification blocked by BZ 1174885
Verified in BPMS 6.1.0.ER5