Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-6759

Parent case/process instances continue before called case instance is closed

    XMLWordPrintable

Details

    • Bug Report
    • Resolution: Won't Fix
    • L3 - Default
    • None
    • 7.5.0
    • None
    • None

    Description

      Related to [this forum post.](https://forum.camunda.org/t/process-instances-continue-before-cmmn-call-activities-are-closed/1486)

      While working with BPMN Call Activities triggering new CMMN case instances from a parent process I noticed that the parent process is continued right after the case instance has reached the internal state of "Completed".
      In our discussion in the forum it became clear, that this is the same behavior as it is implemented for CMMN Case Tasks that call other case instances. The behavior has been taken from the CMMN specs that says:

      When a CaseTask is “blocking” (isBlocking is “true”), the CaseTask is waiting until the Case associated with the CaseTask is completed.

      Of course, this sounds reasonable as one may expect the state "Completed" to be an irreversibly terminal state of the called case instance. This is not true though, as the CMMN spec defines the following states of case instances:

      Completed
      Semi-terminal state for a Case instance, but terminal state for all other EventListener, Milestone, Stage, or Task instances. There is no activity (no behavior being executed) in the element. A Case instance could transition back to Active by engaging in planning at the outermost Stage instance implementing the Case's casePlanModel.

      Closed
      Terminal state. There is no activity (no behavior being executed) in the Case instance, and further planning in the Case's casePlanModel is not permitted. This state is only available for the outermost Stage instance implementing the Case's casePlanModel.

      It becomes clear that at least theoretically the called instance may be changed, even re-activated as it is outlined in the Camunda docs:

      I really think, that above quote from the CMMN specs is sloppy wording and the word "completed" has an overloaded meaning at this point.

      The perceived state "complete" of a case instance equals the "Closed" state as defined in the specs. A "Completed" case instance is not fully complete until it is actually "Closed".

      We further discussed, that currently there is no API to re-activate a completed (but not closed) case instance. Furthermore, the CMMN spec describes that planning means adding discretionary items to the stage that may be worked on. Discretionary tasks aren't implemented right now as well. So ultimately, there is no harm at this point by the way it is implemented (apart from [unclosed case instances in the runtime tables](https://forum.camunda.org/t/deleting-case-sentry-part-and-case-instance-variables-for-complete-or-terminated-case-instances/1478)).

      Anyway, if in further releases a support for reactivating a case instance is planned as it is already documented in the docs and if discretionary items will be supported I think this needs to be revised.

      Furthermore, if you agree with me and I haven't overlooked something, I think this needs to be reworded in the CMMN specs.

      mgm-controller-panel

        This is the controller panel for Smart Panels app

        Attachments

          Activity

            People

              Unassigned Unassigned
              bentrm Benjamin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Salesforce