Namespace RuleWright.Execution
Classes
- LoadedRuleSet
A rule set that has been parsed, validated, and prepared for execution by a RuleWrightEngine: rules are pre-sorted by priority, per-rule content hashes are computed for the compiled-delegate cache, action outputs are prematerialized, and condition nodes are pre-indexed for tracing. Compilation to delegates happens lazily per fact type on first evaluation and is then cached.
- RuleActionContext
Everything an IRuleActionHandler gets to see and touch when its action fires: the firing rule and branch, the action's
targetand already-evaluatedvalue, the fact under evaluation (read-only by convention), and the running outputs. Writes go through SetOutput(string, object?)/RemoveOutput(string) so they land in both the merged result outputs and the firing rule's ownFiredRule.Outputssnapshot, exactly as the built-in action types record theirs.
- RuleCompilationException
Thrown when a structurally valid rule cannot be compiled against a fact type — for example a field path that does not exist on the fact, a comparison value that cannot be converted to the field's type, or an unregistered custom function.
- RuleWrightBuilder
Fluent entry point for configuring and creating a RuleWrightEngine.
- RuleWrightEngine
The RuleWright evaluation engine: loads rule sets (parse → validate → prepare), compiles rules to delegates per fact type via expression trees, caches the compiled delegates by rule content hash, and evaluates facts against them. Thread-safe: one engine instance can serve concurrent evaluations.
Build one with RuleWrightBuilder, which also carries the
MatchesRegexmatch timeout — see UseRegexTimeout(TimeSpan).
Interfaces
- IRuleActionHandler
A custom action type referenced from rule JSON as
{ "type": "<Name>", "target": "...", "value": ... }. Where the built-in action types cover replacing, accumulating, appending, and removing outputs, a handler implements any other way a fired rule should shape the outputs — the rule document still only names the action, and the behaviour stays registered C# code (RuleWrightBuilder.RegisterAction). An unregistered type fails atLoadRuleSet, exactly as an unknown built-in type does.