Environment (Required on creation):
Camunda 7.14.x
Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket):
Steps to reproduce (Required on creation):
- Create a sample BPMN sample.bpmn which contains a user task and a boundary event on User Task.
- Deploy it and start a process instance
- In runtime view of process definition/process instance, 1 token should be waiting at User task
- Remove the boundary event from User Task in BPMN and deploy it again
- Migrate the old process instance to a newer version
- Go to runtime view of process instance/process definition
- The token is missing in the User task
Observed Behavior (Required on creation):
The token is missing in the User task in runtime view of process instance/process definition
Expected behavior (Required on creation):
The token should be there in the User task in runtime view of process instance/process definition
Root Cause (Required on prioritization):
- An active User Task with an attached boundary event is represented by the following execution tree:
Process Instance | Activity A
- Due to the boundary event, the tree defines a context in which events can be received. This context is valid for the lifetime of the user task instance. It, therefore, requires an extra execution.
- An active User Task without an attached boundary event is represented by the following execution tree:
Process Instance
- There is only a single execution that represents the process instance itself
- When the process instance is migrated, the execution tree is compacted and becomes a non-scope execution by transferring the necessary child execution information to the parent execution before the child execution is removed
- The active state is currently not transferred which leads to the unexpected behavior
Solution Ideas (Optional):
In MigratingActivityInstance#becomeNonScope, set the active state from the child to the parent execution.
Hints (Optional):
- ACT_RU_EXECUTION#IS_ACTIVE_ flag for UserTask activity got updated from "true" to "false" during process instance migration.
- Once Async before the flag is added to User Task:
- Process instance migration was successful, but the token was missing in User Task from runtime view.
- With External task and the boundary event
- Process instance migration was successful, and 1 token was active in External Task activity in runtime view.