public static PvmExecutionImpl determinePropagatingExecutionOnEnd ( PvmExecutionImpl propagatingExecution , Map < ScopeImpl , PvmExecutionImpl > activityExecutionMapping ) { if ( ! propagatingExecution . isScope ( ) ) { // non-scope executions may end in the "wrong" flow scope return propagatingExecution ; } else { // superfluous scope executions won't be contained in the activity-execution mapping if ( activityExecutionMapping . values ( ) . contains ( propagatingExecution ) ) { return propagatingExecution ; } else { // skip one scope propagatingExecution . remove ( ) ; PvmExecutionImpl parent = propagatingExecution . getParent ( ) ; parent . setActivity ( propagatingExecution . getActivity ( ) ) ; return propagatingExecution . getParent ( ) ; } } }
Tolerates the broken execution trees fixed with CAM - 3727 where there may be more ancestor scope executions than ancestor flow scopes ;