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

Using the Java API I can modify a Process Instance's Execution State



    • Feature Request
    • Resolution: Fixed
    • L3 - Default
    • 7.3.0, 7.3.0-alpha3
    • None
    • engine
    • None



      • In a single action, I can modify a process instance such that
        • new path(s) of execution are started before or after activities
        • One or more existing activity instances are cancelled
      • I can pass variables when starting an activity
      • i can switch off custom listeners and io mappings
      • out of scope: loops and multi instance



      Users want to modify the execution state of a process instance at runtime.
      For example, they want to "go back in the process" or "skip some of activities".
      The usage context is an "exceptional" one. This is why these transitions are not modeled in the diagram.

      General usecases:

      • repair process instances,
      • testing
      • version migration

      Concrete usecases:

      Provide an API which allows users to

      • start a new execution at a given activity
      • cancel an execution


          .setVariable("someVarName", "someVarValue")
          .setVariableLocal("someVarName", "someVarValue")
        .startAfterActivity("someActivityId", "ancestorActivityInstanceId")
      .execute(); // alternative execute(boolean skipCustomListeners, boolean skipIoMappings);

      Questions for clarification:


      How should this be reflected in History?

      • Historic activity instances are created / canceled regularly
      • There should be a user operation log entry showing that the a state modification operation was performed (separate ticket CAM-3622)

      Relation to suspension

      It should be possible to perform execution state modifications while a process instance is suspended.
      This way a user can suspend a process instance and then "repair" it;
      see separate ticket CAM-3621 for details

      Multi Instance

      How will the starting of activities within a multi instance subprocess be handled?


      Should the API be formulated in terms of

      • Exectuions
      • Tokens
      • Activity Instances

      What is the name of this feature?

      Out of scope


      In the future we may support this as a batch operation, but for now we focus on an individual execution of the operation

      process hierarchy

      It will not be possible to modify multiple process instances at once. Usecases for this is:

      1. a process has a call activity. in the given instance, the call activity is not yet stated. I will not be able to start the call activity such that the sub process instance will start at a given activity.

      Expected behavior for various BPMN constructs

      • Tasks: Start before simply executes a task
      • Events:
        • Start: Start event treats all events like a none-event, or put differently: all events as if the event trigger has already occurred. That means, no message event subscriptions/timer jobs etc. are created
        • Intermediate: Catching and throwing are executed as usual
        • Boundary: Start before executes the event's cancelling semantics; start after does not
        • End: Execution as usual; start after does nothing
        • Event-based Subprocess start event: behavior as a combination of start event and boundary event; start before executes as if the event has occurred and respects the subprocess's cancelling semantics; start after does not cancel anything; users are still able to cancel other activities as they wish, so they can also create the situation in which a task is started in the middle of an event-based subprocess and other activities are cancelled
      • Gateways: start after must always provide a sequence flow (if there is more than one outgoing sequence flow). This is also required with gateways. This flow's condition expression is not evaluated.


        This is the controller panel for Smart Panels app


          Issue Links



                smirnov Roman Smirnov
                meyer Daniel Meyer
                0 Vote for this issue
                4 Start watching this issue