Exemplo n.º 1
0
        public static RuleDto FromRule(IEnrichedRuleEntity rule, bool canRun, IRuleRunnerService ruleRunnerService, Resources resources)
        {
            var result = new RuleDto();

            SimpleMapper.Map(rule, result);
            SimpleMapper.Map(rule.RuleDef, result);

            if (rule.RuleDef.Trigger != null)
            {
                result.Trigger = RuleTriggerDtoFactory.Create(rule.RuleDef.Trigger);
            }

            return(result.CreateLinks(resources, rule, canRun, ruleRunnerService));
        }
Exemplo n.º 2
0
        public static RuleDto FromRule(IEnrichedRuleEntity rule, ApiController controller, string app)
        {
            var result = new RuleDto();

            SimpleMapper.Map(rule, result);
            SimpleMapper.Map(rule.RuleDef, result);

            if (rule.RuleDef.Trigger != null)
            {
                result.Trigger = RuleTriggerDtoFactory.Create(rule.RuleDef.Trigger);
            }

            return(result.CreateLinks(controller, app));
        }
Exemplo n.º 3
0
        public static RuleDto FromRule(IEnrichedRuleEntity rule, Guid?runningRuleId, Resources resources)
        {
            var result = new RuleDto();

            SimpleMapper.Map(rule, result);
            SimpleMapper.Map(rule.RuleDef, result);

            if (rule.RuleDef.Trigger != null)
            {
                result.Trigger = RuleTriggerDtoFactory.Create(rule.RuleDef.Trigger);
            }

            return(result.CreateLinks(resources, runningRuleId));
        }