Hi Carsten
You cannot do that via the DelegateExecution interface as it is actually not considered best practice to make the sub process dependent on the parent process. You can avoid this by passing parameters to the sub process normally – but this depends on the use case. So if you REALLY are sure you want to do it you can easily cast to an implementation class and query the parent:
((ExecutionEntity)execution).getParent();
The casting should always remind you by a small pain that this is maybe not the best idea :-) We can maybe discuss this on Wednesday?
By the way – there is an fox (read: outdated – but still valid) quick start on some possibilities to pass all variables as parameters or the business key here: https://bitbucket.org/camunda/fox-quickstarts-ee/src/master/call-activity-passing-parameter
Cheers
Bernd
Evangelist & Consultant
--
You received this message because you are subscribed to the Google Groups "camunda BPM users & process application developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camunda-bpm-us...@googlegroups.com.
To post to this group, send email to camunda-...@googlegroups.com.
Hi Carsten,
I just checked, in org.camunda.bpm.engine.delegate.DelegateExecution there seems to be a method missing “getSuperProcessInstanceId()”
Would that satisfy your requirements?
I created a Jira: https://app.camunda.com/jira/browse/CAM-1042
Until we provide such a method, you would have to cast Execution to internal implementation class ExecutionEntity and get the Id from there:
ExecutionEntity executionEntity = (ExecutionEntity) delegateExecution;
ExecutionEntity processInstance = executionEntity.getProcessInstance();
ExecutionEntity superExecution = processInstance.getSuperExecution();
if(superExecution != null) {
String superProcessInstanceId = superExecution.getProcessInstanceId();
}
(untested, I hope it works J )
Cheers,
Daniel Meyer
Project Lead
I am still in doubt that we should expose the super process instance via the interface – as a called process instance should not know about it (in the sense of the BPMN spec). My vote goes against it for the moment.
--
But you are right about the parent instance – my code got the parent execution. So better use Daniels code (true most of the time I guess ;-))