Call Activity CMMN - Case does not terminate on interrupting boundary event

Hi all,

I have a quite simple process in which I am using a Call Activity. The Call Activity calls a CMMN case and additionally I have a interrupting boundary event on this Call Activity:

The Call Activity calls following Case:

My problem is that the case stays in state “active” when the interrupting boundary event occurs. Afterwards I end up having the tasks of the Case and the tasks of the process in my task list.
When I try to complete the User Task 1 of the case I get following NullPointer:

Caused by: java.lang.NullPointerException
at org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity.setSuperExecution(CaseExecutionEntity.java:465)
at org.camunda.bpm.engine.impl.cmmn.operation.AbstractAtomicOperationCaseExecutionComplete.postTransitionNotification(AbstractAtomicOperationCaseExecutionComplete.java:91)
at org.camunda.bpm.engine.impl.cmmn.operation.AbstractCmmnEventAtomicOperation.eventNotificationsCompleted(AbstractCmmnEventAtomicOperation.java:40)
at org.camunda.bpm.engine.impl.cmmn.operation.AbstractCmmnEventAtomicOperation.eventNotificationsCompleted(AbstractCmmnEventAtomicOperation.java:26)
at org.camunda.bpm.engine.impl.core.operation.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:65)
at org.camunda.bpm.engine.impl.cmmn.operation.AbstractCmmnEventAtomicOperation.execute(AbstractCmmnEventAtomicOperation.java:26)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:145)
at org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity.performOperationSync(CaseExecutionEntity.java:863)
at org.camunda.bpm.engine.impl.core.operation.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:58)
at org.camunda.bpm.engine.impl.cmmn.operation.AbstractCmmnEventAtomicOperation.execute(AbstractCmmnEventAtomicOperation.java:26)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:145)
at org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity.performOperation(CaseExecutionEntity.java:858)
at org.camunda.bpm.engine.impl.cmmn.execution.CmmnExecution.complete(CmmnExecution.java:982)
at org.camunda.bpm.engine.impl.cmmn.behavior.StageActivityBehavior.checkAndCompleteCaseExecution(StageActivityBehavior.java:466)
at org.camunda.bpm.engine.impl.cmmn.behavior.StageActivityBehavior.handleChildCompletion(StageActivityBehavior.java:408)
at org.camunda.bpm.engine.impl.cmmn.operation.AbstractAtomicOperationCaseExecutionComplete.postTransitionNotification(AbstractAtomicOperationCaseExecutionComplete.java:99)
at org.camunda.bpm.engine.impl.cmmn.operation.AbstractCmmnEventAtomicOperation.eventNotificationsCompleted(AbstractCmmnEventAtomicOperation.java:40)
at org.camunda.bpm.engine.impl.cmmn.operation.AbstractCmmnEventAtomicOperation.eventNotificationsCompleted(AbstractCmmnEventAtomicOperation.java:26)
at org.camunda.bpm.engine.impl.core.operation.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:65)
at org.camunda.bpm.engine.impl.cmmn.operation.AbstractCmmnEventAtomicOperation.execute(AbstractCmmnEventAtomicOperation.java:26)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:145)
at org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity.performOperationSync(CaseExecutionEntity.java:863)
at org.camunda.bpm.engine.impl.core.operation.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:58)
at org.camunda.bpm.engine.impl.cmmn.operation.AbstractCmmnEventAtomicOperation.execute(AbstractCmmnEventAtomicOperation.java:26)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:145)
at org.camunda.bpm.engine.impl.interceptor.CommandContext$1.call(CommandContext.java:134)
at org.camunda.bpm.engine.impl.interceptor.CommandContext$1.call(CommandContext.java:132)
at org.camunda.bpm.engine.impl.context.ProcessApplicationClassloaderInterceptor.call(ProcessApplicationClassloaderInterceptor.java:44)
at org.camunda.bpm.application.impl.EjbProcessApplication.execute(EjbProcessApplication.java:136)
at org.camunda.bpm.application.AbstractProcessApplication.execute(AbstractProcessApplication.java:125)
at sun.reflect.GeneratedMethodAccessor538.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82)
at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93)
at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:73)
at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:52)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ejb3.component.singleton.SingletonComponentInstanceAssociationInterceptor.processInvocation(SingletonComponentInstanceAssociationInterceptor.java:53)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:254)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:329)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:239)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:47)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:100)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ejb3.deployment.processors.StartupAwaitInterceptor.processInvocation(StartupAwaitInterceptor.java:22)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:67)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:54)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)
at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:636)
at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)
at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:198)
at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:185)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java

I am not sure if I have overseen something or if this behaviour is intended? Of course I could add a ExecutionListener to the Boundary event that kills the Case, but I thought that the boundary event should interrupt the Case?

Thank you in advance.

Best
Felix

Hi Felix,

  1. Case stays active when the interrupting boundary event occurs:
    This is currently the intended behavior. As you already mentioned you could an execution listener to terminate the case instance.

  2. NullPointerException:
    This is already a know bug 1.

Cheers,
Roman

1 Like

Hi Roman,

thanks for the quick reply!

To 1) Can you explain a little bit more why this is the intended behaviour? Isn’t it more confusing that the case stays in state active even though the call activity was interrupted?

Best
Felix

Hi Felix,

Since such a scenario is not specified in the BPMN specification, we decided to do nothing in the first step and wait for feedback :wink:

Cheers,
Roman

1 Like

Hi Roman and Felix,
Would it be possible to give an example of an execution listener terminate a case instance? I can’t seem to get hold of the id of the called case instance in the parent process.
Thanks in advance,
Maarten

Hi Roman
I get error while creating instance of following Case . Trying to insert into TaskEntity(13) with CASE_EXECUTION_ID_ ; but that is not found in CASE_EXECUTION table.
ENGINE-03005 Execution of ‘INSERT TaskEntity[13]’ failed. Entity was updated by another transaction concurrently.

<cmmn:case id=“case”>
<cmmn:casePlanModel id=“CasePlanModel_1” name=“A CasePlanModel”>
<cmmn:planItem id=“pi_s1” name=“p1_s1” definitionRef=“s1” />
<cmmn:stage id=“s1” name=“Stage1”>

  <cmmn:planItem id="task_1" definitionRef="HumanTask_1t6ebjc">
    <cmmn:exitCriterion id="task_1_exit_criterion" sentryRef="Sentry_1tismaf" />
  </cmmn:planItem>
  <cmmn:sentry id="Sentry_1tismaf">
    <cmmn:ifPart id="ifpart1">
        <cmmn:condition id="Expression_1i3i4jg">${true}</cmmn:condition>
    </cmmn:ifPart>
  </cmmn:sentry>
  <cmmn:humanTask id="HumanTask_1t6ebjc" name="Task 1" />

 </cmmn:stage>
</cmmn:casePlanModel>

</cmmn:case>

What can be the issue? This works when I remove exitCriterion present on Task. Or works with exitCriterion when I don’t keep humanTask in “Stage”

Hi Felix

Have you come across this issue. I get error while creating instance of following Case . Trying to insert into TaskEntity(13) with CASE_EXECUTION_ID_ ; but that CASE_EXECUTION_ID_is not found in CASE_EXECUTION table. FK constraint violation error.
ENGINE-03005 Execution of ‘INSERT TaskEntity[13]’ failed. Entity was updated by another transaction concurrently.

CMMN file -
<cmmn:case id=“case”>
<cmmn:casePlanModel id=“CasePlanModel_1” name=“A CasePlanModel”>
<cmmn:planItem id=“pi_s1” name=“p1_s1” definitionRef=“s1” />
<cmmn:stage id=“s1” name=“Stage1”>

<cmmn:planItem id=“task_1” definitionRef=“HumanTask_1t6ebjc”>
<cmmn:exitCriterion id=“task_1_exit_criterion” sentryRef=“Sentry_1tismaf” />
</cmmn:planItem>
<cmmn:sentry id=“Sentry_1tismaf”>
<cmmn:ifPart id=“ifpart1”>
<cmmn:condition id=“Expression_1i3i4jg”>${true}</cmmn:condition>
</cmmn:ifPart>
</cmmn:sentry>
<cmmn:humanTask id=“HumanTask_1t6ebjc” name=“Task 1” />

</cmmn:stage>
</cmmn:casePlanModel>
</cmmn:case>

What can be the issue? This CMMN works when I remove exitCriterion present on Task. Or works with exitCriterion when I remove Stage and keep humanTask PlanItem directly under casePlanModel.