SetOutput() public method

public SetOutput ( string argName, Field value ) : void
argName string
value Field
return void
Example #1
0
        public virtual InvokeResult Execute(InvokeContext context)
        {
            var          args         = context.Arguments;
            InvokeResult invokeResult = null;

            try {
                context.Request.Context.OnEvent(new RoutineEvent(Name, args, RoutineInfo.RoutineType));

                var block = context.Request.CreateBlock();
                PrepareBlock(context.Arguments, block);

                var result = ExecuteRoutine(block);

                if (RoutineInfo.RoutineType == RoutineType.Function)
                {
                    invokeResult = context.Result(result);
                }
                else
                {
                    invokeResult = context.Result();
                }

                var output = CollectOutput(block);

                if (output.Count > 0)
                {
                    foreach (var pair in output)
                    {
                        context.SetOutput(pair.Key, pair.Value);
                    }
                }

                return(invokeResult);
            } catch (Exception) {
                throw;
            } finally {
                context.Request.Context.OnEvent(new RoutineEvent(Name, args, RoutineInfo.RoutineType, invokeResult));
            }
        }
Example #2
0
        public virtual InvokeResult Execute(InvokeContext context)
        {
            var args = context.Arguments;
            InvokeResult invokeResult = null;

            try {
                context.Request.Context.OnEvent(new RoutineEvent(Name, args, RoutineInfo.RoutineType));

                var block = context.Request.CreateBlock();
                PrepareBlock(context.Arguments, block);

                var result = ExecuteRoutine(block);

                if (RoutineInfo.RoutineType == RoutineType.Function) {
                    invokeResult = context.Result(result);
                } else {
                    invokeResult = context.Result();
                }

                var output = CollectOutput(block);

                if (output.Count > 0) {
                    foreach (var pair in output) {
                        context.SetOutput(pair.Key, pair.Value);
                    }
                }

                return invokeResult;
            } catch (Exception) {
                throw;
            } finally {
                context.Request.Context.OnEvent(new RoutineEvent(Name, args, RoutineInfo.RoutineType, invokeResult));
            }
        }