Topology 4: Embedding an execution server with your batch execution
This topology consists of either a zRule Execution Server for z/OS instance or a Rule Execution Server instance that is started inside the batch address space. A Db2® database is used as a persistence layer that stores rule applications and data.
Reasons to choose this topology
- To call rules from a COBOL or PL/I batch application in a zRule Execution Server for z/OS instance that runs in the batch address space.
- To call rules from a Java™ batch application in a Rule Execution Server instance that runs in the batch address space.
Architecture
For COBOL and PL/I applications, a zRule Execution Server for z/OS instance is launched locally within the batch address space. A supporting zRule Execution Server for z/OS must be present to enable access to authorized services for the local rule engine. The supporting server can be running in NATIVE mode and it provides a lightweight address space to support the embedded zRule Execution Server for z/OS instance. Alternatively, the supporting server can be running in RULE, TEST, or CONSOLE mode.

For Java applications, a Rule Execution Server instance is launched within the same JVM as the application. An optional Rule Execution Server console can be run in a separate zRule Execution Server for z/OS address space for management purposes.

COBOL or PL/I batch executions
The following processes occur when a z/OS® batch application runs by using an embedded zRule Execution Server for z/OS instance:
- Batch jobs modify their JCL to specify the product load libraries in their STEPLIB and add the HBRENVPR DD statement.
- The HBRCONN API is used to launch a zRule Execution Server for z/OS instance locally. The API call concludes successfully after the environment is ready to execute rules.
- The HBRRULE API call sends a rule request to the local zRule Execution Server for z/OS instance to run each ruleset.
- When the rulesets are completed, the batch job must call the HBRDISC API, which terminated the local zRule Execution Server for z/OS instance in the batch address space.
Java batch executions
The following processes occur when a Java batch application runs rules:
- The Java batch environment is configured by submitting HBRCJCFG, which takes parameters from ++HBRWORKDS++.SHBRPARM(*).
- A JVM is launched with the appropriate configuration options that are required to host a Rule Execution Server instance.
- Java applications use the IlrJ2SESessionFactory and standard API calls to invoke rules against the local Rule Execution Server instance.