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

Modification on sub-process leads to process instance termination

    • Icon: Bug Report Bug Report
    • Resolution: Won't Fix
    • Icon: L3 - Default L3 - Default
    • None
    • 7.16.0, 7.17.0
    • engine
    • None

      Environment (Required on creation):

      Any supported environment. The issue was reproduced in a JUnit test using H2.

      Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket):

      Camunda documents in the modification instruction execution order section (last paragraph) that performing start-before and cancel modifications (in that order) on a sub process instance will preserve that sub process instance. This doesn't seem the case for the following use-case.

      Steps to reproduce (Required on creation):

      1. Start an instance of test_bpmn.bpmn with a variable is_user_task set to true.
      2. Perform a process instance modification
        1. Start before activity Event_10xama1 (the intermediate throw event)
        2. Cancel All for Activity Activity_0rt2g8k (the user task)

      Observed Behavior (Required on creation):

      The process is terminated. The execution doesn't reach the End event (Event_12hdndv) successfully.

      Expected behavior (Required on creation):

      1. The process is modified successfully.
      2. The process is in a COMPLETED state.

      Root Cause (Required on prioritization):

      When the "Start before" instruction is executed, the ancestor scope is incorrectly determined to be the execution that is canceled in the next modification instruction (the user task in the example).

      The new execution (the intermediate throw event) is not created correctly in the execution tree, leading to a termination of the process instance.

      Note:

      The modification works successfullt if the ancestor id is explicitly set.

        This is the controller panel for Smart Panels app

            [CAM-14166] Modification on sub-process leads to process instance termination

            This is not a bug. The reason is the following:

            When a process instance modification instruction is performed, the execution continues until a wait state is reached, or the execution is completed (i.e. the execution token is consumed in BPMN terms).

            The above actions happen before the next process instance modification instruction is performed.

            So in the example provided to reproduce this issue, the following steps are performed:

            1. The instruction "Start before activity Event_10xama1" (the intermediate throw event) is executed
            2. The execution continues until the "end level 2" End event is reached.
            3. The process execution on that branch of the sub-process is finished.
            4. The instruction "Cancel All for Activity Activity_0rt2g8k" (the user task) is executed.
            5. The User task is canceled.
            6. Because there are no other waiting executions, the sub-process is internally terminated, and the root process is terminated as well.

            Therefore, I'm closing this ticket.

            Nikola Koevski added a comment - This is not a bug. The reason is the following: When a process instance modification instruction is performed, the execution continues until a wait state is reached, or the execution is completed (i.e. the execution token is consumed in BPMN terms). The above actions happen before the next process instance modification instruction is performed. So in the example provided to reproduce this issue, the following steps are performed: The instruction "Start before activity Event_10xama1" (the intermediate throw event) is executed The execution continues until the "end level 2" End event is reached. The process execution on that branch of the sub-process is finished. The instruction "Cancel All for Activity Activity_0rt2g8k" (the user task) is executed. The User task is canceled. Because there are no other waiting executions, the sub-process is internally terminated, and the root process is terminated as well. Therefore, I'm closing this ticket.

              Unassigned Unassigned
              nikola.koevski Nikola Koevski
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: