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
namestringThe case-sensitive action type name used in rule JSON.
handlerAction<RuleActionContext>The action implementation.
Returns
Exceptions
- ArgumentException
nameis null/empty, a built-in action type, or already registered.- ArgumentNullException
handleris null.
RegisterAction(IRuleActionHandler)
Registers a custom action handler under its Name.
public RuleWrightBuilder RegisterAction(IRuleActionHandler handler)
Parameters
handlerIRuleActionHandlerThe handler; must expose a non-empty name and be thread-safe.
Returns
Exceptions
- ArgumentNullException
handleris null.- ArgumentException
The handler's name is null/empty, a built-in action type, or already registered.