Consider the following model:
and this code:
runtimeService.createProcessInstanceByKey("key")
.setVariable(VARIABLE_NAME, "1")
.startBeforeActivity("A")
.executeWithVariablesInReturn();
Expected result:
A single instance of B is active. A was never active
Current result:
A single instance of B is active. A has been started and immediately interrupted (history entries are present).
Reasoning:
When the sub process scope is instantiated, the conditional event should trigger immediately and therefore instantiation should abort.
Side note:
The linked commit contains a similar test case of a different situation.