Steps to reproduce:
- start a process instance of the as screenshot attached process, the execution tree looks as follows:
- set a local execution variable on user task B: runtimeService.setVariableLocal(B, "foo", "bar");
- complete user task A: taskService.complete(A);
- complete user task B: taskService.complete(B);
- the joining parallel gateway is executed
- the resulting execution tree looks as follows:
The variable foo is still set as local variable of the execution e2.
- the local variable foo is deleted after joining parallel gateway.
The joining parallel gateway is left by the execution e2.
See failing test case: https://github.com/camunda/camunda-bpm-platform/commit/5a069dc35ea533c1d04de1d04ec5ddb45f8f3c83