public DelegateInvocationAnonymousInnerClass2(CallableElementActivityBehavior outerInstance,
                                               IActivityExecution execution, IVariableScope subInstance, IDelegateVariableMapping varMapping)
     : base(execution, null)
 {
     this._outerInstance = outerInstance;
     this._execution     = execution;
     this._subInstance   = subInstance;
     this._varMapping    = varMapping;
 }
        public override void Execute(IActivityExecution execution)
        {
            var variables = GetInputVariables(execution);

            IDelegateVariableMapping varMapping = ResolveDelegation(execution);

            if (varMapping != null)
            {
                InvokeVarMappingDelegation(new DelegateInvocationAnonymousInnerClass(this, execution, variables, varMapping));
            }

            var businessKey = GetBusinessKey(execution);

            StartInstance(execution, variables, businessKey);
        }
        public virtual void PassOutputVariables(IActivityExecution execution, IVariableScope subInstance)
        {
            // only data. no control flow available on this execution.
            IVariableMap variables      = FilterVariables(GetOutputVariables(subInstance));
            var          localVariables = GetOutputVariablesLocal(subInstance);

            execution.Variables      = variables;
            execution.VariablesLocal = localVariables;

            IDelegateVariableMapping varMapping = ResolveDelegation(execution);

            if (varMapping != null)
            {
                InvokeVarMappingDelegation(new DelegateInvocationAnonymousInnerClass2(this, execution, subInstance, varMapping));
            }
        }