You can use an Ant task to automate the generation of COBOL code from a ruleset archive.
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.
To generate COBOL code using an Ant task:
<IBMIMSharedDir>\plugins\com.ibm.rules.zrules.zxom_8.0.0.vXX\lib\cobol-gen-shared.jar
<IBMIMSharedDir>\plugins\com.ibm.rules.zrules.zxom_8.0.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.
<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:
| Attribute | Required | Description |
|---|---|---|
| rulesetfile | Yes | The ruleset file that is targeted to generate the COBOL program. |
| cobolprogId | Yes | The program ID of the generated COBOL program. |
| cobolfile | Yes | The generated COBOL program file. |
| codegenconfigfile | Yes | CobolGenConfig.xml: the configuration file for COBOL code generation. |
| compileoptionsfile | Optional | CobolCompilerOptions.properties: the configuration file for the COBOL program file encoding and character code page. The default options are:
|
| xomconfigfile | Optional | CobolXomConfig.xml: the configuration file for the COBOL XOM. It includes the COBOL copybook information. Required only for rule projects with a BOM created from a copybook. |
| bomconfigfile | Optional | CobolBomConfig.xml: the configuration file for the COBOL-enabled BOM. Required only for rule projects with a COBOL-enabled BOM. |
| enableCics | Optional | The flag to enable COBOL code generation for a CICS® program. |
| cicsprogId | Optional | The program ID for the generated CICS wrapper program. |
| cicsfile | Optional | The generated CICS wrapper program file |
The following table defines the element you can use for the gen-cobol Ant task:
| Element | Required | Description |
|---|---|---|
| refconfigfolder | Optional | The resource folder for the configuration files for the referenced rule project. Used for COBOL rule projects that have a reference structure. |
© Copyright IBM Corporation 1987, 2012. | Terms and conditions for information centers | Feedback
This information center is Built on Eclipse™. (www.eclipse.org)