Exemple #1
0
        private IRuleExecutionSet CreateRuleExecutionSetFromCLP(StringReader reader, IDictionary <object, object> props)
        {
            try
            {
                string name        = "Untitled";
                string description = "Generic rule execution set";

                // TODO: Remove default value of null!  This is the "billion dollar mistake" at work.
                IRuleExecutionSet rs = null;

                // TODO: props should never be null!
                if (props != null)
                {
                    if (props.ContainsKey("name"))
                    {
                        name = props["name"] as string;
                    }

                    if (props.ContainsKey("description"))
                    {
                        description = props["description"] as string;
                    }

                    rs = new RuleExecutionSet(name, description, null);
                    IEngine engine = new Engine(reader, rs.Engine);
                    engine.Parse = false;
                    rs.Engine.Reset();
                }
                return((RuleExecutionSet)rs);
            }
            catch (Exception e)
            {
                throw new RuleExecutionSetCreateException("Internal error.", e);
            }
        }
 public void RegisterRuleExecutionSet(string name, IRuleExecutionSet ruleExecutionSet, IDictionary <object, object> collection)
 {
     throw new System.NotImplementedException();
 }