Transitions in a CMMN case can happen in two ways: Either by external interaction or by events occurring and conditions being fulfilled. The former refers to any explicit interaction with a case that is triggered from the outside. For example, a human worker completing a human task would be such an interaction. Completing a task means that the corresponding plan item is completed, depending on the actual case model, the case instance may complete.

    Similar changes in the state of a case instance may be driven by events occurring or conditions getting fulfilled. For example, it is possible to define that when one plan item completes, another is enabled. Similarly, a plan item can terminate when an event triggers. When specifying plan items, this concept is referred to as entry criteria and exit criteria. These criteria are always defined for individual plan items, not for plan item definitions. For example, the following case model fragment defines an entry criterion for the plan item PlanItem_HumanTask_1:

    1. <definitions>
    2. <case id="case" name="Case">
    3. <casePlanModel id="CasePlanModel_1">
    4. <planItem id="PlanItem_HumanTask_1" definitionRef="HumanTask_1">
    5. <entryCriterion sentryRef="Sentry_1" />
    6. </planItem>
    7. <planItem id="PlanItem_HumanTask_2" definitionRef="HumanTask_1"/>
    8. <sentry id="Sentry_1">
    9. <planItemOnPart sourceRef="PlanItem_HumanTask_2">
    10. <standardEvent>complete</standardEvent>
    11. </planItemOnPart>
    12. </sentry>
    13. <humanTask id="HumanTask_1" camunda:assignee="kermit" />
    14. </casePlanModel>
    15. </case>
    16. </defintions>

    Similarly, PlanItem_HumanTask_1 with an exit criterion looks as follows:

    1. <planItem id="PlanItem_HumanTask_1" definitionRef="HumanTask_1">
    2. <exitCriterion sentryRef="Sentry_1" />
    3. </planItem>

    The conditions and events behind entry and exit criteria can be expressed by so-called sentries. Refer to the Sentry section on how sentries work and what kind of conditions can be expressed by them.

    When any entry criterion is met, the plan item it is defined for performs the state transition from AVAILABLE to ENABLED. While the plan item is not in state AVAILABLE, entry criteria are not relevant.

    Any exit criteria can only be met when the corresponding plan item is in the ACTIVE state.When any exit criterion is met, a plan item performs a state transition from ACTIVE to state TERMINATED.

    The details of plan item states and transitions are provided in the Plan Item Lifecycles section.

    原文: https://docs.camunda.org/manual/7.9/reference/cmmn11/concepts/entry-exit-criteria/