Hello,
i’m experimenting with the CMMN API and i need a kind of auto completion within a milestone. For better understanding i have an example:
There is a case definition with a human task (with entry criterion) and a milestone (with entry criterion). The condition of the two conditions are the opposite of them. For example: Sentry milestone: ${shipmentOrderCompletedSentry.shipmentOrderCompleted(execution.getBusinessKey()) == true}, sentry human task: ${shipmentOrderCompletedSentry.shipmentOrderCompleted(execution.getBusinessKey()) == false}
If i start a case instance the human task will be triggered and the task will be in the state “active”. In the next step the shipment data will be completed and the milestone will be triggered.
The milestone is reached, but the human task is still active. Is there a CMMN Engine feature to auto complete the human task. Or it is needed that human task have to be manually completed (via API)?
Kind Regards,
Eberhard
Hi Eberhard,
take a look at the Task/Stage Lifecycle.
As you can see you have two options if the task is active: complete or terminate.
I don’t know if I understand you correctly.
But in your case I would let the milestone occur an Exit Criterion on the human task.
What exactly is your task for? If this is the part where you complete the shipment data you should complete it and let the task occur and Entry Criterion on the milestone. Then one Sentry would be redundant.
Kind regards,
Dominik
1 Like
Hello Dominik,
thanks for repling
My CMMN model looks like this:
It should be possible to repeat the task “Complete shipment order” since the data is complete. Then it is not possible to add the onPart to the milestone.
Perhaps it is possible to trigger a kind of event to complete the task?
Kind Regards,
Eberhard
Hi Eberhard,
So the problem is, that the “Complete Shipment order” Task is still possible after the milestone is reached?
Mabey you should put the task into a Stage and Exit the Stage when the milestone is reached.
I don’t know if this is exactly what you want. Mabey you can explain it a bit more in detail
Kind Regards,
Dominik
Hi Dominik,
thanks for this approach. I have solved the problem with this model:
Thanks!
Kind Regards,
Eberhard
Hi Eberhard,
you are right, the stage isn’t necessary that way.
But I think with the “create” part you are only able to do the “complete shipment order” once, because the create event on the milestone is only triggered once… or am I wrong?
If you want to be able to do “complete shipment order” as many times as you want until the milestone is reached, I think you should do it that way:
Just and idea
Kind Regards,
Dominik
Hi Dominik,
yes you are right. I lost the repeatable option with the “create” onPart. Thanks for the hint
Greetings,
Eberhard
1 Like