CMMN: Exit criterion terminates case execution of an active process task, but not the process instance


#1

Hi folks,

another question regarding the behaviour of CMMN exit criterions in Camunda:

When an exit criterion terminates a process task, it seems that the corresponding process instance is not affected at all (cf. https://github.com/stefanzilske/cmmn-exit-criterion/blob/master/src/test/java/io/holunda/example/cmmn/exitcriterion/ProcessTerminateTest.java). The process instance remains active, even though the case execution is terminated.

Especially, it behaves differently from terminating a human task with its exit criterion, as the corresponding task instance is terminated.

It this the expected behaviour? What is best practice to deal with the process instance, which obviously should be cancelled or terminated in some way?

Cheers,
Stefan


#2

Hi Stefan,

This topics discusses the same issue the other way round (BPMN calling CMMN): Call Activity CMMN - Case does not terminate on interrupting boundary event. I think the discussion and proposed workaround apply here as well.

Cheers,
Thorben


#3

Hi Thorben,

thanks for your answer! I wasn’t aware of this other topic.

Now, you are saying that I could use an execution listener to handle the process instance myself - but is this supported for exit criterions or sentries at all? At least, the Camunda Modeler won’t let me define listeners there.

Cheers,
Stefan


#4

Hi Stefan,

I think you can add the listener to the terminate transition of the process task.

Cheers,
Thorben


#5

Thank you @thorben, that sounds like a reasonable idea!

Cheers,
Stefan