Table of Contents

Class RuleActionContext

Namespace
RuleWright.Execution
Assembly
RuleWright.Execution.dll

Everything an IRuleActionHandler gets to see and touch when its action fires: the firing rule and branch, the action's target and already-evaluated value, 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 own FiredRule.Outputs snapshot, exactly as the built-in action types record theirs.

public sealed class RuleActionContext
Inheritance
RuleActionContext
Inherited Members

Properties

Branch

Which branch fired: actions or else.

Fact

The fact under evaluation. Treat it as read-only.

RuleId

The id of the rule whose branch fired.

Target

The action's target output key.

Value

The action's value, already evaluated against the fact (a constant, field read, computed expression, or call result). Null when the action declared no value.

Methods

RemoveOutput(string)

Removes a key from the running outputs and the firing rule's own snapshot.

SetOutput(string, object?)

Writes a key into the running outputs and the firing rule's own snapshot.

TryGetOutput(string, out object?)

Reads a key from the running outputs (what earlier-fired rules have written).