cancel
Showing results for 
Search instead for 
Did you mean: 

Fetch parent instance id using subprocess instance

steff1
Champ in-the-making
Champ in-the-making
Hi there

I would like to get the id of the parent process instance. Is it always sufficient to make the following calls based on the ProcessInstance of the subprocess?

subProcessProcessInstance.getSuperExecution().getProcessInstanceId()

I'm just wondering if there is any case where this is not sufficient.

Thanks in advance
Stefan
3 REPLIES 3

jbarrez
Star Contributor
Star Contributor
In case you have more nested subprocesses, you have to be careful. Otherwise it alwyas gives you the id of the execution from which the sub process instance was spawned.

steff1
Champ in-the-making
Champ in-the-making
Thanks for the reply!

Which cases do you mean could fail?

I already tried a two level sub process hierarchy (parent calls subProcess, subProcess calls subSubProcess). There I'm able to went up the hierarchy with the mentioned expression.

Cheers,
Stefan

jbarrez
Star Contributor
Star Contributor
I'm thinking a more complex combination with multi instances, concurrencies and everything else that might go wrong 😉