Data descriptor
Table tasks need to reference a data element. The data descriptor defines a data element, such as a table.
The data descriptor is the definition of a table. It includes the table name, the name of the file that
contains the table data, and the fields that comprise each record in the table. A one-to-one correspondence
exists between a data definition and table data. An example of an account data table is shown in the following
example:
<?xml version="1.0"?>
<dataDescriptor name="Account" type="TABLE">
<fileName>account.tbl</fileName>
<record>
<field name="account" type="key" datatype="pack" length="10"/>
<field name="payload" type="payload" datatype="byte" length="17"/>
</record>
</dataDescriptor>A data descriptor has the following elements:
- The
<dataDescriptor>element is the root element and holds the remainder of the elements. The name of the data and the type of data to be defined must be specified. - The
<fileName>element contains the name of the physical file that holds the actual table data. - The
<record>element holds the definition of all the fields that comprise each row of the table. Each<field>element is the definition of an individual field.- The
<field>element must contain the name of the field, the type of the field, the data type of the field, and the length of the field in bytes.
- The
The following table shows the values for the type attribute of the
<field>
element.
| Field type value | Definition |
|---|---|
| key | This field is part of the table key. |
| cutoffKey | This field is the ending time and date in a range. The starting time and date of the range is calculated by subtracting 1 from the ending time and date of the previous record. If this record is the first record in the table, the starting time and date is set to 0. There can be only one cutoffKey per table. |
| wildCardKey | This field is part of the table key and is used to do the initial table lookup. If the initial lookup does not find a record, more table look ups are done by using different combinations of the fields that are specified as wildcard keys. |
| startKeyRange | This field is the starting value of a range of values. |
| endKeyRange | This field is the ending value of a range of values. |
| payload | This field is part of the payload that is returned to the caller. |
| accumPayload | The first time that the table is called, this field is set the same way as the payload field type. If the table is called more than one time, each new payload is appended to the current payload as a comma-separated value (CSV). |
| nextTable | This field contains the name of the next task that is called. |
The following table shows the values for the data type attribute of the
<field>
element.
| Field data type value | Definition |
|---|---|
| byte | The field contains binary data. |
| char | The field contains character data. |
| pack | The field contains packed binary coded decimal data. |