Hello,
I am looking for an easy way, to get all active tasks from a process instance. My BPMN processes has a lot of nested sub processes. I have a main process, which calls activities, which call other activities and so forth.
I could try to get all active task with the REST API “/engine-rest/task” and “bubble up” by searching the parents, but this seems very inefficient. I would like to go top down, but this seems to be a lot of search calls, too. Isn’t there are direct connection between an active instances and all it active tasks?
Is there a are query getAllTaskByRootProcessId?
You should use a business key which would propagate down through all Call Activities and then when you query for tasks. You can add processInstanceBusinessKey as a parameter which would make sure you get all related tasks without needing to worry about the process they belong to.
You can read more about how to use business keys on T-Dogs blog post here.
Is your process waiting at a user task?
Also have you passed the business key to each call activity? You need to explicitly tick the box on the call activity which propagates the parent key to the child process.
Hi Niall,
thanks for the hint. It is working now. I had a white space in the business key. This seems to be a problem, even though I put the white space in the query string. I guess white spaces are not allowed (it wasn’t intended to use white spaces anyway)?