Beispiel #1
0
        public void Process(WorkflowPipelineArgs args)
        {
            Assert.ArgumentNotNull(args, "args");

            if (args.DataItem == null)
            {
                return;
            }

            var context = new WorkflowRuleContext(args);

            var actionItem = args.ProcessorItem.InnerItem;

            if (actionItem == null)
            {
                return;
            }

            if (actionItem["execute global rules"] == "1")
            {
                RunGlobalRules(args.DataItem.Database, context);
            }

            var rules = RuleFactory.GetRules <WorkflowRuleContext>(actionItem.Fields["rules"]);

            rules.Run(context);
        }
        private static void RunGlobalRules(Database database, WorkflowRuleContext context)
        {
            //TODO: Replace with GUID ?
            var rulesFolder = database.GetItem("/sitecore/system/Settings/Rules/Workflow/Rules");
            
            if (rulesFolder == null) return;

            var rules = RuleFactory.GetRules<WorkflowRuleContext>(rulesFolder, "rules");

            rules.Run(context);
        }
Beispiel #3
0
        private static void RunGlobalRules(Database database, WorkflowRuleContext context)
        {
            //TODO: Replace with GUID ?
            var rulesFolder = database.GetItem("/sitecore/system/Settings/Rules/Workflow/Rules");

            if (rulesFolder == null)
            {
                return;
            }

            var rules = RuleFactory.GetRules <WorkflowRuleContext>(rulesFolder, "rules");

            rules.Run(context);
        }
        public void Process(WorkflowPipelineArgs args)
        {
            Assert.ArgumentNotNull(args, "args");

            if (args.DataItem == null) return;

            var context = new WorkflowRuleContext(args);

            var actionItem = args.ProcessorItem.InnerItem;

            if (actionItem == null) return;

            if (actionItem["execute global rules"] == "1")
            {
                RunGlobalRules(args.DataItem.Database, context);
            }

            var rules = RuleFactory.GetRules<WorkflowRuleContext>(actionItem.Fields["rules"]);

            rules.Run(context);
        }