AnsweredAssumed Answered

How to get the parent processInstance id from call activity

Question asked by yila_ya3116816 on Sep 13, 2013
Latest reply on Sep 16, 2013 by trademak

I'm facing a problem to fetch the parent processInstance ID. I have a parent workflow calls a subprocess which is a call activitiy. This subprocess agains calls another call activity. Now I want to get the parent processInstance id while subprocess running. I tried getSuperExecution and subProcessInstanceId(subProcessInstanceId) but either returns null.

Below is what I tried inside service task:

String pid = execution.getProcessInstanceId();
String parentId =execution.getEngineServices().getRuntimeService().createProcessInstanceQuery().subProcessInstanceId(pid).singleResult().getProcessInstanceId();


ExecutionEntity executionEntity = (ExecutionEntity) execution.getEngineServices().getRuntimeService().createExecutionQuery().executionId(execution.getId()).singleResult();
String parentID = executionEntity.getSuperExecution().getProcessInstanceId();

Either returns null.

Anyone can help me with this?? Thanks a lot!!