keuss
June 19, 2020, 11:14am
1
Hi,
I need to easely get list of tasks by ids. How it could be done (with java api) ?
I already saw this TaskQuery for tasks of several processes - #4 by langfr and read this Process Engine API | docs.camunda.org
But i did not manage to make it work (no taskIdIn
like taskCandidateGroupIn
).
Thanks !
langfr
June 19, 2020, 1:16pm
2
I did not try this, but my understanding from the docs is, that this should work:
List<Task> tasks = this.taskService.createTaskQuery().or().taskId( "id1" ).taskId( "id2" ).....endOr().list();
Tasks with id1 or id2 or … will be retrieved.
keuss
June 19, 2020, 3:04pm
3
I’ve just tested this : List<Task> tasks = this.taskService.createTaskQuery().or().taskId("f421d0a1-b23c-11ea-b79f-005056913223").taskId("0f75f84d-b23d-11ea-b79f-005056913223").endOr().list();
I only get the last task … as explained here Process Engine API | docs.camunda.org
Whenever a non-variable-filter-criterion is used more than once inside a query, only the value which was applied last is utilized