예제 #1
0
        protected internal virtual ExecutionEntity findSuperExecution(ExecutionEntity parentScopeExecution, ExecutionEntity topmostCancellableExecution)
        {
            ExecutionEntity superExecution = null;

            if (parentScopeExecution == null)
            {
                superExecution = topmostCancellableExecution.getSuperExecution();
            }
            return(superExecution);
        }
예제 #2
0
        public static void handleChildRemovalInScope(ExecutionEntity removedExecution)
        {
            ActivityImpl activity = removedExecution.getActivity();

            if (activity == null)
            {
                if (removedExecution.getSuperExecution() != null)
                {
                    removedExecution = removedExecution.getSuperExecution();
                    activity         = removedExecution.getActivity();
                    if (activity == null)
                    {
                        return;
                    }
                }
                else
                {
                    return;
                }
            }
            ScopeImpl flowScope = activity.FlowScope;

            PvmExecutionImpl scopeExecution         = removedExecution.getParentScopeExecution(false);
            PvmExecutionImpl executionInParentScope = removedExecution.Concurrent ? removedExecution : removedExecution.Parent;

            if (flowScope.ActivityBehavior != null && flowScope.ActivityBehavior is ModificationObserverBehavior)
            {
                // let child removal be handled by the scope itself
                ModificationObserverBehavior behavior = (ModificationObserverBehavior)flowScope.ActivityBehavior;
                behavior.destroyInnerInstance(executionInParentScope);
            }
            else
            {
                if (executionInParentScope.Concurrent)
                {
                    executionInParentScope.remove();
                    scopeExecution.tryPruneLastConcurrentChild();
                    scopeExecution.forceUpdate();
                }
            }
        }