Method parameter types
You can define methods using primitive and class types as arguments and return values. You can also define an instance method in the BOM and write COBOL code using a placeholder.
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.
You can define methods using the following types as arguments and return values:
Primitive types
String, Date and class types
Class type from BOM classes
You can also define an instance method in the BOM and write COBOL code using a placeholder.
For mapped methods, you can use a COBOL section to define and validate COBOL data items associated to method arguments and return values. You define the parameter mapping between the Java™ type and the COBOL type using the COBOL mapped method data table. For example, the following method has two parameters:
public static void addCharge(String type, double amount)
In this case, the default COBOL definition is automatically populated as follows:
| Parameter Name | Java Type | COBOL Type |
|---|---|---|
| type | java.lang.String | PIC X(20) |
| amount | double | COMP-2 |
You can edit the COBOL Type.