Table of Contents

Class Rule

Namespace
RuleWright.Core
Assembly
RuleWright.Core.dll

A single business rule: a condition tree plus the actions applied when it passes. Immutable after construction; parsed once from JSON and compiled once per fact type.

public sealed class Rule
Inheritance
Rule
Inherited Members

Constructors

Rule(string, ConditionNode, IEnumerable<RuleAction>?, string?, int, bool, IEnumerable<RuleAction>?, string?)

Creates a rule.

Properties

Actions

Actions applied when the condition passes, in document order.

Condition

The root of the condition tree.

Description

Optional human-readable summary.

ElseActions

Actions applied when the condition does not pass, in document order. Empty when the rule has no else branch, in which case a non-matching rule contributes nothing.

Enabled

Whether the rule participates in evaluation.

FailureMessage

Optional authored explanation surfaced as a RuleFailure on the evaluation result when the rule is evaluated and its condition does not pass. Like Description, it changes what the result reports, never what the rule computes, so it plays no part in the rule's content hash.

Id

Unique identifier within the rule set.

Priority

Higher-priority rules are evaluated first; ties keep document order.