ILOG JRules User Guide > Executing Rules > Tasks > Executing a Ruleset Using Rule Execution Server > Implementing a Ruleset Execution Interceptor

To implement a ruleset execution interceptor you must perform a number of steps on both the application side and on the Rule Execution Server side.

To implement a ruleset execution interceptor on the application side:

  1. Write a class that implements the interface IlrSessionRequestInterceptor.
  2. Note
    This class should have a public constructor with no parameter. The class can:
    The following code provides an example of such a class:
public class IlrTestInterceptor implements 
IlrSessionRequestInterceptor {
     public IlrTestInterceptor() {
     }
     public IlrSessionRequest transform(IlrSessionRequest
                      executionRequest, IlrRuleAppInformation ruleAppInfo)
             throws IlrTransformException {
         String newPath = null;
         IlrSessionExecutionSettings execSettings =
             executionRequest.getExecutionSettings();
         IlrSessionDescriptor desc =
             executionRequest.getSessionDescriptor();
         String path = desc.getRulesetPath();
         if (path.indexOf("ruleset") < 0) {
             //RuleAppPath case
             newPath = path + "/ruleset1";
         } else {
             newPath = path.replace('1','3');
         }
         IlrSessionRequest newRequest = null;
    if (execSettings instanceof IlrSessionStatefulExecutionSettings)
      {
      IlrSessionStatefulExecutionSettings statefulExecSettings =
         (IlrSessionStatefulExecutionSettings)execSettings;
      newRequest = new IlrSessionRequest(newPath,
         statefulExecSettings.getResetRuleflow());
      }
    else
      newRequest = new IlrSessionRequest(newPath);
         return newRequest;
     }
}
  1. Package the class with your XOM classes.
  2. Set the enableInterceptor boolean of the request's descriptor to true.

To implement a ruleset execution interceptor on the Rule Execution Server side:

Related Concepts

Rule Sessions
Message-Driven Rule Beans

Related Tasks

Creating a POJO Client Project for RuleApps
Creating a Web Service or Monitored Transparent Decision Service Project for RuleApps
Creating an SCA Component Client Project for RuleApps
Maintaining Execution Code Generators
Invoking a Ruleset Using a Stateless Rule Session
Invoking a Ruleset Using a Stateful Rule Session
Invoking a Ruleset Using a Message-Driven Rule Bean
Tracing Ruleset Execution
Monitoring Ruleset Execution Using the MBeans Accessor API
Handling Rule Engine Exceptions in Rule Execution Server