internal RuleEngine(RuleSet ruleSet, RuleValidation validation, ActivityExecutionContext executionContext)
        {
            if (!ruleSet.Validate(validation))
            {
                throw new RuleSetValidationException(string.Format(CultureInfo.CurrentCulture, Messages.RuleSetValidationFailed, new object[] { ruleSet.name }), validation.Errors);
            }
            this.name       = ruleSet.Name;
            this.validation = validation;
            Tracer tracer = null;

            if (WorkflowActivityTrace.Rules.Switch.ShouldTrace(TraceEventType.Information))
            {
                tracer = new Tracer(ruleSet.Name, executionContext);
            }
            this.analyzedRules = Executor.Preprocess(ruleSet.ChainingBehavior, ruleSet.Rules, validation, tracer);
        }
        public RuleEngine(RuleSet ruleSet, RuleValidation validation)
        {
            // now validate it
            if (!ruleSet.Validate(validation))
            {
                string message = string.Format(CultureInfo.CurrentCulture, Messages.RuleSetValidationFailed, ruleSet.name);
                throw new RuleSetValidationException(message, validation.Errors);
            }

            this.name       = ruleSet.Name;
            this.validation = validation;
            Tracer tracer = null;

            if (WorkflowActivityTrace.Rules.Switch.ShouldTrace(TraceEventType.Information))
            {
                tracer = new Tracer(ruleSet.Name);
            }
            this.analyzedRules = Executor.Preprocess(ruleSet.ChainingBehavior, ruleSet.Rules, validation, tracer);
        }