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 will be 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) and the miniloan XOM (which contains the Loan 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=/usr/lpp/zDM/V8R8M0/zexecutionserver/samples/hbrsamples.jar:/usr/lpp/zDM/V8R8M0/zexecutionserver/samples/ruleApps/MiniLoanDemo/MiniLoanDemo-xom.zip
  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.
  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.