You can use an Ant task to automate the generation of COBOL
code from a ruleset archive.
About this task
Deprecated feature:
The COBOL code generation feature is deprecated in V8.5. This feature will be removed in a
future release of the product. Use the COBOL Generation Project Migration
wizard to migrate your Rules for COBOL project to a zRule Execution
Server for z/OS compatible rule project. See Deprecated features for migration details.
In
a production environment, it is common to automate tasks using a build
tool. Decision Server provides
custom Ant tasks to automate COBOL code generation from a ruleset
archive. You can use an Ant task to generate the COBOL code for rules
that have been written in Rule Designer or Decision Center.
Procedure
To generate COBOL code using an Ant task:
- Before using an Ant task to generate the COBOL code, define
the class path in an Ant file. The resource archives are stored in
following directories:
<IBMIMSharedDir>\plugins\com.ibm.rules.zrules.zxom_8.10.0.vXX\lib\cobol-gen-shared.jar
<IBMIMSharedDir>\plugins\com.ibm.rules.zrules.zxom_8.10.0.vXX\lib\cobol-shared.jar
Where <IBMIMSharedDir> is
the shared libraries directory for IBM® Installation Manager, and vXX is
the version number. Replace this variable with the actual version
for your installation.
<InstallDir>\executionserver\lib\jdom-1.0.jar
<InstallDir>\executionserver\lib\jrules-engine.jar
<InstallDir>\executionserver\lib\jrules-language.jar
Where <InstallDir> is
the Operational Decision Manager installation
directory.
- Define the custom Ant task in the Ant file, by including
the following code:
<taskdef resource="cblruletasks"
classpathref="classpath" />
This code defines the
following Ant task for COBOL code generation:
<gen-cobol rulesetfile="miniloanruleset.jar"
cobolprogId="miniloan"
cobolfile="miniloan.cbl"
codegenconfigfile="CobolGenConfig.xml">
<refconfigfolder dir="referenceProject/resources/cobol " />
</gen-cobol>
The following table defines the attributes you can
use for the gen-cobol Ant task:
The following table defines the element you can use for
the gen-cobol Ant task:
| Element |
Required |
Description |
| refconfigfolder |
 |
The resource folder for the configuration files for the referenced
rule project. Used for COBOL rule projects that have a reference structure. |
- Run the Ant task to generate the COBOL code.