Restarting process instance and trigger compensation handlers

Hi,

I am trying to call 2 processes as call activity from the main process. I need to trigger the compensation handlers for the first process if the 2nd process has caught an error. I am using

runtimeService.createProcessInstanceModification(execution.getVariable(“processID”).toString())
.startBeforeActivity(“subprocess-name”).execute();

where the subprocess has compensation throw event.

But it throws the below error ,
signal1.bpmn (5.7 KB)
signalmain.bpmn (3.2 KB)

java.lang.NullPointerException: null org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl.getFlowScopeExecution(PvmExecutionImpl.java:1491)

Any leads?

Regards,
Hetal

Hi,

any updates on this?

Regards,
Hetal

Any answers please? i am stuck on this, May be I am understanding it wrong or something?

Regards,
Hetal

This got solved. I used a different approach to rollback the other processes.

Can you upload your solution?

Hi,

We used signals to trigger the rollback of the other processes completed. See the below process.


During each process called, we will collect the signal names for which the rollback has to be triggered.
Assume the failure occurred at Task 3 then the Error-Event will trigger the compensation of the same process and will signal the start event of the completed process synchronously as shown in figure.

The signal process has the same compensation tasks in reverse order. It can be made asynchronous as well.

Regards,
Hetal

1 Like