public void AddRuleTree(WonkaBizRulesEngine poNewRuleTree, bool pbExecuteOnChain = true) { poNewRuleTree.GroveId = GroveDesc; poNewRuleTree.GroveIndex = (uint)RuleTreeMembers.Count; RuleTreeMembers.Add(poNewRuleTree); if (pbExecuteOnChain) { ExecuteRuleTreesOnChain.Add(poNewRuleTree); } }
public void SetRuleTreeToExecuteOnChain(WonkaBizRulesEngine poTargetRuleTree, bool pbExecuteOnChain = true) { if (RuleTreeMembers.Contains(poTargetRuleTree)) { if (pbExecuteOnChain) { ExecuteRuleTreesOnChain.Add(poTargetRuleTree); } else { ExecuteRuleTreesOnChain.Remove(poTargetRuleTree); } } else { AddRuleTree(poTargetRuleTree, pbExecuteOnChain); } }
/// <summary> /// /// This constructor should only be used when we call Splinter() to break up a current RuleTree /// and form a new Grove with the main child branches under the root. Several assumptions are then /// assumed here, like an instantiation of the WonkaRefEnvironment taking place already. /// /// /// </summary> public WonkaBizRulesEngine(WonkaBizRuleSet poRootRuleSet, WonkaBizRulesEngine poRefEngine) { UsingOrchestrationMode = true; AddToRegistry = false; RefEnvHandle = Init(null); AllRuleSets = new List <WonkaBizRuleSet>(); RuleTreeRoot = poRootRuleSet; SourceMap = poRefEngine.SourceMap; CustomOpMap = poRefEngine.CustomOpMap; AllRuleSets.Add(poRootRuleSet); foreach (WonkaBizRuleSet TmpBizRuleSet in poRootRuleSet.ChildRuleSets) { AddRuleSets(TmpBizRuleSet); } this.RetrieveCurrRecord = AssembleOtherProduct; }