Table of Contents

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

json string

The rule document JSON.

Returns

LoadedRuleSet

Exceptions

ArgumentNullException

json is 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

ruleSet RuleSet

The rule set.

Returns

LoadedRuleSet

Exceptions

ArgumentNullException

ruleSet is null.

RuleCompilationException

A referenced custom function is not registered, or an action type is unknown.