Table of Contents

Method RegisterAction

Namespace
RuleWright.Execution
Assembly
RuleWright.Execution.dll

RegisterAction(string, Action<RuleActionContext>)

Registers a custom action type referenced from rule JSON as { "type": "...", "target": "...", "value": ... }. The delegate receives a RuleActionContext carrying the action's target, its already-evaluated value, the fact, and read/write access to the running outputs. It must be thread-safe.

public RuleWrightBuilder RegisterAction(string name, Action<RuleActionContext> handler)

Parameters

name string

The case-sensitive action type name used in rule JSON.

handler Action<RuleActionContext>

The action implementation.

Returns

RuleWrightBuilder

Exceptions

ArgumentException

name is null/empty, a built-in action type, or already registered.

ArgumentNullException

handler is null.

RegisterAction(IRuleActionHandler)

Registers a custom action handler under its Name.

public RuleWrightBuilder RegisterAction(IRuleActionHandler handler)

Parameters

handler IRuleActionHandler

The handler; must expose a non-empty name and be thread-safe.

Returns

RuleWrightBuilder

Exceptions

ArgumentNullException

handler is null.

ArgumentException

The handler's name is null/empty, a built-in action type, or already registered.