Super Execution is null when boundary event is attached

Hello guys,

I have a problem using the super execution of the DelegateExecution java Object.

Here is my process:
boundaryError

The ‘Send Notifications’ is a Call Activity element bind to this process :

When my ‘Send Notification’ service is executed i need to get the super execution to get the process instance parent ID (delegateExecution.getSuperExecution().getProcessInstanceId() ) .

The problem is that when i attach a boundary error event on my service task , the super execution is null . When there is no boundary error event attach to my service task , i can get the super execution .

Do you know why ? It’s very annoying for me :confused: . Help please :smiley:

No answer, maybe it is a bug? Can someone try to reproduce? Thanks .

Hi @nhafsaoui,

you should be able to always get the parent process instance id by

public void execute(DelegateExecution delegateExecution) throws Exception {
  String parentProcessInstanceId = null;
  DelegateExecution superExecution = delegateExecution.getProcessInstance().getSuperExecution();
  if (superExecution != null) {
    parentProcessInstanceId = superExecution.getProcessInstanceId();
  }
  // do something with the parent id
}

With this, you are retrieving the id of the super execution of your current process instance, which is what you actually want to know.

The other call chain is based on the assumption that your current execution is the process instance itself, which is not always the case, e.g. when boundary events are defined.

Hope that helps you!

Cheers,
Tobias