You create domains by using data stored in an Excel spreadsheet.
You can set up an Excel file with the domain values you want to use,
using a separate sheet for each domain.
About this task
You create dynamic domains for a COBOL project by using
values extracted from an Excel spreadsheet. You set up an Excel file
with the domain values you want to use, using a separate sheet for
each domain. You then store the Excel file in the resources folder
of your rule project.
Important: If you want
to change domain values, you must update the Excel file. You cannot
edit the BOM members from within the BOM.
Procedure
- Define the required domain values in an Excel spreadsheet.
As a minimum, each Excel sheet you use must include the following
columns:
Value
Label
BOM to XOM mapping
COBOL values
For example, if you use the following COBOL copybook and define
a domain named country that has a set of values such
as {China, France, USA}, you might define the following
columns and values for Country:
05 country PIC X(2).
05 color PIC 9(12).
Value |
Label |
BOM to XOM mapping |
COBOL values |
CHINA |
CHINA |
Color.createCountry(“CN”) |
CN |
FRANCE |
FRANCE |
Color.createCountry(“FR”) |
FR |
USA |
USA |
Color.createCountry(“US”) |
US |
Make sure that the Excel file has the correct structure.
- Save the file to the resources folder
in your rule project.
- In the BOM editor, open the BOM class for which you want
to create a domain.
- In the Domain section, click Create
a domain.
- Select , and then click Next.
- In the Excel File field, select
the Excel file from the resources folder in your
rule project.
- In the Sheet field, select the worksheet
that contains the values for the required domain.
- Select the Table with header check-box
so that the drop-down lists display the names of the columns instead
of the default column letters.
- In the Value column, BOM
to XOM column, and Label column fields,
select the corresponding columns in your Excel file.
- Click Next and then click Add,
to add a custom property
- For the name of your custom property, enter: cobol_domain_value.
- In the Excel file, select the column that contains the
COBOL values for the domain.
- Save your work.
Results
The BOM editor displays the domain values, and you can
now use them when writing rules.