Sample: Using ruleset interceptors with zRule Execution Server for z/OS

In this sample, you learn how to enable ruleset interceptors for the Miniloan application. The sample interceptor runs after the rule execution and returns extra information about the rule execution.

Before you begin

  1. Configure an instance of zRule Execution Server for z/OS®.
  2. Deploy the COBOL or PL/I Miniloan RuleApp and the execution object model (XOM) to the persistence layer by submitting the++HBRWORKDS++.SHBRJCL(HBRDPLOY) job.

About this task

The Miniloan application executes a set of loan eligibility rules against financial data for two borrowers. A message is returned that states whether the loans were approved or rejected. When the sample ruleset interceptor is enabled, extra messages are returned from the rule excution, which provide the following information:
  • RuleApp version executed = 1.0
  • Ruleset version executed = 1.0
  • Execution ID = 2f33d071-9c7f-4820-91f7-b0746ae874d50
Where the actual values from your rule execution are displayed.

The Java™ source code for this sample interceptor can be found in ++HBRINSTPATH++/zexecutionserver/samples/hbrsamples.jar.

Procedure

  1. Configure your zRule Execution Server for z/OS instance to enable interceptors by setting HBRINTERCEPTORS=YES in the ++HBRWORKDS++.SHBRPARM(HBRCMMN) member.
  2. Place the hbrsamples.jar, which contains the interceptor class, on the class path of the zRule Execution Server for z/OS instance.
    Edit the ++HBRWORKDS++.SHBRPARM(HBRMSTR) member and add the following item to the CLASSPATH_SUFFIX:
    CLASSPATH_SUFFIX=/ODM/zexecutionserver/samples/hbrsamples.jar
  3. Start your zRule Execution Server for z/OS instance.
  4. Run the Miniloan application by submitting either the ++HBRWORKDS++.SHBRJCL(HBRMINB) or ++HBRWORKDS++.SHBRJCL(HBRMINBP) job.
    Note: Alternatively, you can use HBRMINBM instead of HBRMINB. The HBRMINBM sample is a version of the COBOL Miniloan sample that is designed to illustrate just the means of calling Operational Decision Manager from COBOL, without the additional complexities of reading in sample data.
  5. Verify that the JOBSTEP return code is set to 0.
  6. View the execution results in SDSF, which now include the extra rule execution data. The Miniloan application returns a completion code and a reason code if an error occurs.