Table of Contents

Constructor Rule

Namespace
RuleWright.Core
Assembly
RuleWright.Core.dll

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

Creates a rule.

public Rule(string id, ConditionNode condition, IEnumerable<RuleAction>? actions = null, string? description = null, int priority = 0, bool enabled = true, IEnumerable<RuleAction>? elseActions = null, string? failureMessage = null)

Parameters

id string

Unique identifier within the rule set.

condition ConditionNode

The root of the condition tree.

actions IEnumerable<RuleAction>

Actions applied when the condition passes; may be empty.

description string

Optional human-readable summary.

priority int

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

enabled bool

Disabled rules are skipped entirely during evaluation.

elseActions IEnumerable<RuleAction>

Actions applied when the condition does not pass; may be empty.

failureMessage string

Optional authored explanation surfaced as a RuleFailure on the evaluation result when the rule is evaluated and its condition does not pass.

Exceptions

ArgumentException

id is null or empty.

ArgumentNullException

condition is null, or actions/elseActions contains null.