CMMN Milestone inside a Stage

71 views
Skip to first unread message

Dominik Mohr

unread,
Aug 16, 2015, 10:45:17 AM8/16/15
to camunda BPM users
I have two case models and I think both are valid case models. One contains a human task and a milestone and the other one contains a human task and a milestone within a stage. The process engine can start them both but in the second model the milestone is completed as soon as the stage becomes active. But there is a sentry attached to the milestone that should wait for the  human task to finish. In the first model, the milestone only completes if the human task is completed.

So the question is if a milestone can be nested inside a stage and if so, why does it complete when the stage becomes active?
milestone-inside-stage.cmmn10.xml
milestone-without-stage.cmmn10.xml

Roman Smirnov

unread,
Aug 17, 2015, 2:27:17 AM8/17/15
to camunda BPM users
Hi Dominik,

That is the expected behavior. According to the CMMN 1.0 specification there are the followings constraints:

- Chapter 5.4.5 – PlanItem, table 19, page 36: „entryCriteriaRefs“ („exitCriteriaRefs“): „EntryCriteriaRefs of a PlanItem must refer to Sentries that are contained by the Stage or PlanFragment that contains that PlanItem.”

- Chapter 5.4.6.3 – PlanItemOnPart, table 23, page 39: “sourceRef”: „SourceRef represents a PlanItem that must be contained by the same PlanFragment (or Stage) that also contains the Sentry that contains the PlanItemFragment.”


That means that the sentry declaration must be contained by the stage. So if just move the sentry element into the stage, then it should work.


There is another "problem" with your model (ie. milestone-inside-stage.cmmn10.xml): It is not allowed to have plan item definitions (like human task etc.) inside the stage. The plan item definitions must be declared "top level" inside the case plan model.


Does it help you?


Cheers,

Roman

Dominik Mohr

unread,
Aug 17, 2015, 6:14:43 AM8/17/15
to camunda BPM users
Thanks for the clarification. I was a bit confused by the camunda documentation and some tests. But with the sentry also contained inside the stage the milestone behaves like expected.

The plan item definitions are all contained in the case plan model at the top level. The definition in my example is just below the stage. But thanks for the info :)

Dominik Mohr

unread,
Aug 17, 2015, 6:38:42 AM8/17/15
to camunda BPM users
There is one follow up question:

A stage can have an entry criterion and an exit criterion. I guess the entry criterion sentry should be defined outside the stage as it can only be connected to an element outside. How about the exit criterion. Can the stage be terminated from inside and outside with the exit criterion? And where should the exit criterion sentry be defined?

Cheers,
Dominik


Am Montag, 17. August 2015 08:27:17 UTC+2 schrieb Roman Smirnov:

Roman Smirnov

unread,
Aug 18, 2015, 2:33:55 AM8/18/15
to camunda BPM users
Hi Dominik,

A stage can have an entry criterion and an exit criterion. I guess the entry criterion sentry should be defined outside the stage as it can only be connected to an element outside.

This corret.

 How about the exit criterion. Can the stage be terminated from inside and outside with the exit criterion? And where should the exit criterion sentry be defined?

The consistency conditions are also valid for the exit criteria. So a stage can only reference a sentry as an exit criterion which is outside the stage. In consequence a stage can only be terminated from the outside (except the case plan model).

Depending on your use case you can use the property autoComplete [1] to complete the stage automatically.

Cheers,
Roman



Dominik Mohr

unread,
Aug 18, 2015, 10:29:07 AM8/18/15
to camunda BPM users
Great, thanks for the infos, again!

I think my tool is finally working correct :)
Reply all
Reply to author
Forward
0 new messages