public WonkaBizRulesEngine(StringBuilder psRules, Dictionary <string, WonkaBizSource> poSourceMap, Dictionary <string, WonkaBizSource> poCustomOpBlockchainSources, IMetadataRetrievable piMetadataSource = null, bool pbAddToRegistry = true) { if ((psRules == null) || (psRules.Length <= 0)) { throw new WonkaBizRuleException("ERROR! Provided rules are null or empty!"); } UsingOrchestrationMode = true; AddToRegistry = pbAddToRegistry; RefEnvHandle = Init(piMetadataSource); WonkaBizRulesXmlReader BreXmlReader = new WonkaBizRulesXmlReader(psRules, piMetadataSource, this); foreach (string sKey in poCustomOpBlockchainSources.Keys) { WonkaBizSource oTargetSource = poCustomOpBlockchainSources[sKey]; BreXmlReader.AddCustomOperator(sKey, oTargetSource); } RuleTreeRoot = BreXmlReader.ParseRuleTree(); SourceMap = poSourceMap; CustomOpMap = poCustomOpBlockchainSources; AllRuleSets = BreXmlReader.AllParsedRuleSets; this.RetrieveCurrRecord = AssembleOtherProduct; }
public WonkaBizRulesEngine(StringBuilder psRules, IMetadataRetrievable piMetadataSource = null, bool pbAddToRegistry = false) { if ((psRules == null) || (psRules.Length <= 0)) { throw new WonkaBizRuleException("ERROR! Provided rules are null or empty!"); } UsingOrchestrationMode = false; AddToRegistry = pbAddToRegistry; RefEnvHandle = Init(piMetadataSource); WonkaBizRulesXmlReader BreXmlReader = new WonkaBizRulesXmlReader(psRules, piMetadataSource, this); RuleTreeRoot = BreXmlReader.ParseRuleTree(); AllRuleSets = BreXmlReader.AllParsedRuleSets; }
public WonkaBizRulesEngine(string psRulesFilepath, IMetadataRetrievable piMetadataSource = null, bool pbAddToRegistry = false) { if (String.IsNullOrEmpty(psRulesFilepath)) { throw new WonkaBizRuleException("ERROR! Provided rules file is null or empty!"); } if (!File.Exists(psRulesFilepath)) { throw new WonkaBizRuleException("ERROR! Provided rules file(" + psRulesFilepath + ") does not exist on the filesystem."); } UsingOrchestrationMode = false; AddToRegistry = pbAddToRegistry; RefEnvHandle = Init(piMetadataSource); WonkaBizRulesXmlReader BreXmlReader = new WonkaBizRulesXmlReader(psRulesFilepath, piMetadataSource, this); RuleTreeRoot = BreXmlReader.ParseRuleTree(); AllRuleSets = BreXmlReader.AllParsedRuleSets; }
public WonkaBizRulesEngine(StringBuilder psRules, Dictionary <string, WonkaBizSource> poSourceMap, IMetadataRetrievable piMetadataSource = null, bool pbAddToRegistry = false) { if ((psRules == null) || (psRules.Length <= 0)) { throw new WonkaBizRuleException("ERROR! Provided rules are null or empty!"); } UsingOrchestrationMode = true; AddToRegistry = pbAddToRegistry; RefEnvHandle = Init(piMetadataSource); WonkaBizRulesXmlReader BreXmlReader = new WonkaBizRulesXmlReader(psRules, piMetadataSource, this); RuleTreeRoot = BreXmlReader.ParseRuleTree(); SourceMap = poSourceMap; AllRuleSets = BreXmlReader.AllParsedRuleSets; this.RetrieveCurrRecord = AssembleOtherProduct; }