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)); } }
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)); } }