private static void workflowParse() { AntlrInputStream w3inputstream; BaseRuleEngineDL efw = new BaseRuleEngineDL(ConfigurationManager.AppSettings[""], new TimeSpan(0, 1, 0, 0)); var rulesChunk = DB.GetWorkFlowRules(100); foreach (var flowRulesPoco in rulesChunk) { w3inputstream = new AntlrInputStream(flowRulesPoco.RuleXPath); var w3Lexer = new XPath1W3Lexer(w3inputstream); var w3Tokens = new CommonTokenStream(w3Lexer); var w3Parser = new XPath1W3Parser(w3Tokens) { BuildParseTree = true }; var w3Tree = w3Parser.start(); //w3tree.ToStringTree(w3parser); XPath1W3Visitor w3Visitor = new XPath1W3Visitor(); flowRulesPoco.ConvertedCode = w3Visitor.Visit(w3Tree); //efw.InsertOrUpdateRule(flowRulesPoco.Map()); } }
public void TestCSCCompileRules() { BaseRuleEngineDL dl = new BaseRuleEngineDL(ConfigurationManager.AppSettings["RulesEngine"], new TimeSpan(0, 0, 1, 0)); CSCCompilerBL target = new CSCCompilerBL(dl, "ReferenceDesign_RuleApplied"); List <RuleAppliedBase> rules = new List <RuleAppliedBase> { new RuleAppliedBase { RuleCategoryId = 1, ApplyOrder = 2, //Code = "string s = \"test\"; return s;", IsEnabled = true, RuleSubCategoryId = 3, ConditionCodeId = 4, RuleAppliedId = 5, CodeId = 6, //ConditionCode = "if(1==1)", } }; PrivateObject obj = new PrivateObject(target); var retVal = obj.Invoke("CompileRules", rules); }
public BasicGUI() { InitializeComponent(); RulesDAL = new BaseRuleEngineDL(ConfigurationManager.AppSettings["RulesEngine"], new TimeSpan(1, 0, 0, 0)); CodeTextEnabled = true; ConditionTextEnabled = true; GetButtonEnabled = true; PromoteButtonEnabled = true; RuleAppliedIdTBEnabled = true; RuleCategoryCBEnabled = true; RuleInputTypesLBEnabled = true; RuleOutputTypesLBEnabled = true; RuleSubCategoryCBEnabled = true; RuleTableTBEnabled = true; SaveButtonEnabled = true; RuleAppliedTables = RulesDAL.GetRuleppliedTables(); }
public void TestReferenceDesignRule() { try { BaseRuleEngineDL rulesDL = new BaseRuleEngineDL(ConfigurationManager.AppSettings["RulesEngine"], new TimeSpan(0, 0, 5, 0)); var rulesBL = new ReferenceRuleEngineBL <DyanmicLoadGenericObject, DyanmicLoadGenericObject>(rulesDL); DyanmicLoadGenericObject claim = new DyanmicLoadGenericObject(); RuleAppliedFilter raf = new RuleAppliedFilter { RuleCategoryId = 3, }; var output = rulesBL.RunRules(raf, claim); Assert.IsTrue(output.Result != null); } catch (Exception ex) { Console.WriteLine(ex); } }
public void TestBaseRuleEngineWrapper1() { BaseRuleEngineDL dl = new BaseRuleEngineDL(ConfigurationManager.AppSettings["RulesEngine"], new TimeSpan(0, 0, 1, 0)); var re = new ReferenceRuleEngineBL <DyanmicLoadGenericObject, DyanmicLoadGenericObject>(dl); }