コード例 #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));
        }