Case in status TERMINATED

Hi,

I have a question regarding cmmn and its integration in the process engine.

When executing a process which has a call activity pointing to a cmmn case, the process only proceed if the case is completed.
If the case terminates the token will stay at the call activity and the process will noch proceed.

I do not unterstand this concept.
For example all Exit Criteria which can be modelled at case level will lead to termination of case specified by cmmn.
So if any Exit Criteria will be triggered my parent bpmn process will not proceed.

This fact means it is not possible to use Exit Criteria on cmmn cases if they are called by an call activity of a BPMN process but I think Exit Criteria is a powerful construct to model exit points of a case. Maybe if Task A and B were completed and milestone AB occurred the Case should terminate.

Exit Criteria is also used on your marketing poster which shows the interaction of DMN, CMMN and BPMN but in my opinion the construct modelled there would never work because of the described concept.

What is your opinion about this issue? Maybe the Process should also process if the called case status changed to TERMINATED?

Best regards,

Markus

Should I create a Jira Issue for this?
In my opinion it is important that call activity will finish and process will proceed if case is terminated.

Best regards,

Markus

Hi Markus,

Sorry for the late response.

Your observation is correct. Whenever the case instance is terminated the calling process instance does not proceed. Only if the case instance has been completed successfully, then the calling process instance is notified about that and proceeds with the execution. So far it is the expected behavior.
This behavior is also aligned with the specification of ProcessTask and CaseTask in CMMN. So, once the called process or case instance is completed successfully, only then the calling task gets completed. However, the BPMN specification does not say anything how to handle such a situation.

I agree with you, that the current situation is not sufficient. But I would not expect that the process instance proceeds with the execution in case of termination. As an alternative, I would suggest that for example an error event is thrown, so that the calling process instance can handle that situation. What do you think about that?

Cheers,
Roman

Hi Roman,

Thanks for your reply.
In my opinion, TERMINATED is not a negative outcome of a case but a determines that the case reached a state where further work of the knowledge worker is not useful (for example because reaching a defined Exit Criterion).

So I would suggest that the process will continue if state TERMINATED is reached.
But maybe it is a mistake in my interpretation of state TERMINATED.
If a BPMN Error is thrown, it also states that TERMINATED is a negative state of a case.

Do you interpreted it as negative outcome of a case?

Best regards,

Markus

Hi Markus.

I tend to agree with this:[quote=“Markus, post:4, topic:623”]
In my opinion, TERMINATED is not a negative outcome of a case but a determines that the case reached a state where further work of the knowledge worker is not useful
[/quote]

How did you move on in your case?

As a workaround in my current scenario I created a CaseExecutionListener on the terminate event to execute the same behavior normally executed when finishing a CaseInstance, see:

public class SignalProcessInstanceListener implements CaseExecutionListener {

  @Override
  public void notify(DelegateCaseExecution ctx) throws Exception {
    new MyOperationCaseTerminate().doWhatIWant((CaseExecutionEntity) ctx);
  }

  public static class MyOperationCaseTerminate extends AbstractAtomicOperationCaseExecutionComplete {

    public void doWhatIWant(CmmnExecution execution) {
      super.postTransitionNotification(execution);
    }

    public String getCanonicalName() {
      return null;
    }

    protected void triggerBehavior(CmmnActivityBehavior behavior, CmmnExecution execution) {
    }

  }

}

Cheers
Bernd

Hi Bernd,

Actual I try to avoid TERMINATE state for cases.

I will test your code snippet and let you know if it works or us .

As a hint:
In my opinion the process on camunda poster which demonstrates CMMN, DMN, and BPMN in collaboration, does not work.
The process would never complete because the case only finishes with terminate states and then the call activity would never finish and process would never complete.

Best regards,

Markus