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
idstringUnique identifier within the rule set.
conditionConditionNodeThe root of the condition tree.
actionsIEnumerable<RuleAction>Actions applied when the condition passes; may be empty.
descriptionstringOptional human-readable summary.
priorityintHigher-priority rules are evaluated first; ties keep document order.
enabledboolDisabled rules are skipped entirely during evaluation.
elseActionsIEnumerable<RuleAction>Actions applied when the condition does not pass; may be empty.
failureMessagestringOptional authored explanation surfaced as a RuleFailure on the evaluation result when the rule is evaluated and its condition does not pass.
Exceptions
- ArgumentException
idis null or empty.- ArgumentNullException
conditionis null, oractions/elseActionscontains null.