Method LoadRuleSet
- Namespace
- RuleWright.Execution
- Assembly
- RuleWright.Execution.dll
LoadRuleSet(string)
Parses, validates, and prepares a JSON rule document (a single rule or a rule set) for evaluation. Parsing and validation happen exactly once here; per-fact-type compilation happens lazily on first evaluation and is cached by rule content hash.
public LoadedRuleSet LoadRuleSet(string json)
Parameters
jsonstringThe rule document JSON.
Returns
Exceptions
- ArgumentNullException
jsonis null.- InvalidOperationException
No JSON reader was configured on the builder.
- RuleParseException
The text is not well-formed JSON.
- RuleValidationException
The document fails schema validation.
- RuleCompilationException
A referenced custom function is not registered, or an action type is unknown.
LoadRuleSet(RuleSet)
Prepares an already-constructed domain RuleSet for evaluation, bypassing JSON entirely.
public LoadedRuleSet LoadRuleSet(RuleSet ruleSet)
Parameters
ruleSetRuleSetThe rule set.
Returns
Exceptions
- ArgumentNullException
ruleSetis null.- RuleCompilationException
A referenced custom function is not registered, or an action type is unknown.