Table of Contents

Interface IActionInterceptor

Namespace
NRules.Extensibility
Assembly
NRules.dll

Extension point for rule actions interception. An instance of IActionInterceptor can be assigned to ActionInterceptor or ActionInterceptor, so that invocation of all rule actions is delegated to the interceptor. The interceptor is free to add pre- or post-processing to action invocations, error handling, or decide not to invoke the actions.

public interface IActionInterceptor

Remarks

When actions are invoked via IActionInterceptor, exceptions thrown by actions are not wrapped into RuleRhsExpressionEvaluationException. It is the responsibility of the interceptor to handle the exceptions. Exceptions thrown from the interceptor are not handled by the engine and just propagate up the stack.

Methods

Intercept(IContext, IEnumerable<IActionInvocation>)

Called by the rules engine in place of the action invocations when a rule fires. The interceptor can add behavior to action invocation and choose to either proceed with the invocations or not.

void Intercept(IContext context, IEnumerable<IActionInvocation> actions)

Parameters

context IContext

Action context, containing information about the firing rule and matched facts.

actions IEnumerable<IActionInvocation>

Action invocations for rule actions being intercepted.