In my process I have some compensation handlers in case BPMN transaction will be cancelled. Now assume, that last action (assign SIM in HSS) fails and both compensation activities should be called. Unassign devices in DM will be called first, but it fails too (throw BMPN exception, which should be catched by exception boundary event). So, in my expectation, the process should be finished in state ‘Rollback failed’, but instead I get ProcessEngineException. And there is some strange stackstrace with ArrayIndexOutOfBoundsException
But if last compensation handler will fail (invalidate subscriptions in my case), engine will behave as expected
Part of stacktrace:
java.lang.ArrayIndexOutOfBoundsException: -1
at java.util.ArrayList.elementData(ArrayList.java:422) ~[?:1.8.0_181]
at java.util.ArrayList.get(ArrayList.java:435) ~[?:1.8.0_181]
at org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl.createActivityExecutionMapping(PvmExecutionImpl.java:1564) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl.createActivityExecutionMapping(PvmExecutionImpl.java:1480) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl.createActivityExecutionMapping(PvmExecutionImpl.java:1493) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.pvm.runtime.LegacyBehavior.isCompensationThrowing(LegacyBehavior.java:624) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationActivityInstanceEnd.eventNotificationsStarted(PvmAtomicOperationActivityInstanceEnd.java:50) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationDeleteCascadeFireActivityEnd.eventNotificationsStarted(PvmAtomicOperationDeleteCascadeFireActivityEnd.java:36) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationDeleteCascadeFireActivityEnd.eventNotificationsStarted(PvmAtomicOperationDeleteCascadeFireActivityEnd.java:31) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.core.operation.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:43) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:99) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.invokeNext(CommandInvocationContext.java:131) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performNext(CommandInvocationContext.java:111) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performOperation(CommandInvocationContext.java:86) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:646) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:620) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationDeleteCascade.execute(PvmAtomicOperationDeleteCascade.java:64) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationDeleteCascade.execute(PvmAtomicOperationDeleteCascade.java:25) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:99) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.invokeNext(CommandInvocationContext.java:131) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performNext(CommandInvocationContext.java:111) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performOperation(CommandInvocationContext.java:86) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:646) ~[camunda-engine-7.12.0.jar:7.12.0]
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:620) ~[camunda-engine-7.12.0.jar:7.12.0]