示例#1
0
 public ActionResult Exec(IActionContext context)
 {
     try
     {
         ChainUtility.Run(this.Setup, context);
         ChainUtility.Run(this.Body, context);
     }
     finally
     {
         ChainUtility.Run(this.Teardown, context);
     }
     return(ActionResult.FromContext(context));
 }
示例#2
0
文件: For.cs 项目: obpt123/workflow
        public ActionResult Exec(IActionContext context)
        {
            List <Dictionary <string, object> > res = new List <Dictionary <string, object> >();

            for (int i = 0, val = Start; i < Count; i++, val += Step)
            {
                using (var newcontext = context.BeginContext())
                {
                    if (!string.IsNullOrEmpty(ItemName))
                    {
                        newcontext.Vars[ItemName] = val;
                    }
                    ChainUtility.Run(this.Entry, newcontext);
                    res.Add(context.GetContextValues());
                }
            }

            return(new ActionResult(res));
        }
示例#3
0
文件: Loop.cs 项目: obpt123/workflow
        public ActionResult Exec(IActionContext context)
        {
            List <Dictionary <string, object> > res = new List <Dictionary <string, object> >();

            if (Source != null)
            {
                foreach (var item in Source)
                {
                    using (var newcontext = context.BeginContext())
                    {
                        if (!string.IsNullOrEmpty(ItemName))
                        {
                            newcontext.Vars[ItemName] = item;
                        }
                        ChainUtility.Run(this.Entry, newcontext);
                        res.Add(context.GetContextValues());
                    }
                }
            }
            return(new ActionResult(res));
        }