Steps to reproduce:
- start a process instance of the as screenshot attached process
- set a local execution variable on user task B: runtimeService.setVariableLocal(B, "foo", "bar");
- complete user task A: taskService.complete(A);
- the engine performs internally an execution tree compaction
In the history there are two historic variable instances of variable foo.
- the local variables are still present
- the corresponding historic variable instance is updated and there does not exist a second historic variable instance for the variable foo
The local variables are copied from the child execution to the parent execution.
See failing test cases: https://github.com/camunda/camunda-bpm-platform/commit/9c85f156c058dcc4ab42f79c6dca546700178a26