示例#1
0
 public RuleCondition(string name, RuleEvaluator evaluator)
 {
     Log.LogMessage(Log.LogLevels.DETAILED, "RuleCondition constructor: " + name);
     this.name          = name;
     this.ruleEvaluator = evaluator;
     this.ruleEvaluator.SetCondition(this);
 }
示例#2
0
 public Rule(string name, RuleEvaluator evaluator, RuleAction action)
 {
     Log.LogMessage(Log.LogLevels.DETAILED, "Rule Constructor (with Action): " + name);
     this.name      = name;
     this.evaluator = evaluator;
     AddAction(action);
 }
        private void dereference()
        {
            Log.LogMessage(Log.LogLevels.DETAILED, "Dereferencing WorkingRule for Rule: " + rule.GetName() + " and DataSet: " + dataSet.getName());

            foreach (RuleAction a in rule.GetActions())
            {
                this.actionExecutors.Add(a.getExecutor());
            }
            this.evaluator = rule.GetEvaluator();

            foreach (string dependencyName in this.evaluator.dependantDataPointNames)
            {
                Log.LogMessage(Log.LogLevels.DETAILED, "Connecting WorkingRule Dependencies for Rule: " + rule.GetName() + " and DataSet: " + dataSet.getName());

                // Find this dependency in the current dataSet
                DataPoint dp = this.dataSet.getDataPoint(dependencyName);
                if (dp != null)
                {
                    dp.GetSource().addRuleEventHandler(this);
                }
            }
        }
示例#4
0
        private void Dereference()
        {
            Log.LogMessage(Log.LogLevels.DETAILED, "Dereferencing WorkingRule for Rule: " + rule.GetName() + " and DataSet: " + dataSet.GetName());

            foreach (Action a in rule.GetActions())
            {
                Log.LogMessage(Log.LogLevels.DETAILED, "Adding Executor for: " + a.GetName());
                this.executors.Add(a.GetExecutor());
            }

            foreach (RuleCondition c in rule.GetConditions())
            {
                RuleEvaluator e = c.GetEvaluator();
                Log.LogMessage(Log.LogLevels.DETAILED, "Adding Evaluator for: " + c.GetName());
                this.evaluators.Add(e);

                foreach (String dpn in e.dependantDataPointNames)
                {
                    DataPoint dp = this.dataSet.GetDataPoint(dpn);
                    Log.LogMessage(Log.LogLevels.DETAILED, "Adding dependent DataPointSource for: " + dp.GetName());
                    dp.GetSource().AssociateWorkingRule(this);
                }
            }
        }
示例#5
0
 public Rule(string name, RuleEvaluator evaluator)
 {
     Log.LogMessage(Log.LogLevels.DETAILED, "Rule Constructor: " + name);
     this.name      = name;
     this.evaluator = evaluator;
 }