I’m making a little grade project and decided to make good use of Camunda as bpmn tool. So far it works great, but I encountered a situation that goes as follows:
I have a process that calls another process (as an activity, by a bpmn file), and that one calls another activity process (also another bpmn file).
So far there are 3 levels.
I want to get the current task id from the third level (or the nth level if exists…), but I only have the first process instance id (the one that started all the flow).
So the question is how to get that task id (to complete) by calling the Rest API without making too much recursive calls, is there a nice way to do it?
I currently calling /process-instance?superProcessInstance=myProcessId to get the child subprocesses and the repeat that until I get to the desired level and get the task by name or the like
I think it’s not the correct approach, so that’s why I’m here asking
Thanks for the quick response.
Can you tell me where to assign that business key? It’s a value that only lives with the current processes instances or a fixed one?
I checked in Camunda Modeler the option “Business key” in each Call Activity and it works fine, I can get the related tasks, complete them and everything else.
But now I have a called Activity that calls another Activity, and that last one (when the child process starts) got “null” as the business key (I can see this null at Camunda Cockpit).
Multilevel business key pass is allowed?
Any idea about this?
At the start of the first parent process I pass the businessKey the way you provided.
When it reaches the first Call Activity it pass correctly, but inside that Activity, it’s called another child Call Activity.
Happens that that called activity gets a “null” as the businessKey value.
I tried and it worked for me.
Have a look at “SecondProcess.bpmn”, maybe the problem is that SubB, SubC and SubD are not call activities but sub processes?