Choose the Data Type for Each Field

The fields in a GetMetadata response for a web service connector must have a specific type which Policy Modeling will accept. These field data types include STRING, DATE, TIMEOFDAY, DATETIME, BOOLEAN and DECIMAL.

For example:

<Field name="Model" type="STRING" can-be-input="true" can-be-output="false" is-required="false"/>
<Field name="Price" type="DECIMAL" can-be-input="true" can-be-output="false" is-required="false"/>

The choice of which data type the attribute will have is very important. The following table explains when to use each field data type.

Table 1. The field data types in a GetMetadata response
Field data type When to use
STRING If a field should contain an arbitrary piece of text, that includes a specially formatted date, time, or number such as a phone number, but this value is not expected to be parsed as a value other than a string
BOOLEAN If a field should describe a simple true or false value
DECIMAL If a field should describe a number value
DATE If a field should describe a date value where both the time and the timezone are irrelevant
TIMEOFDAY If a field should describe a time value where the date and the timezone are irrelevant, and only the hours, minutes and seconds are relevant
DATETIME If a field should describe a record at a precise moment in time, that is, where the date and timezone are important

Note: A field must have a data type, but this does not mean that it will contain data in Load and Save transactions. For example, the value may be null. The metadata describes the data type of the possible value that the field may carry. Note also that type cannot be specified for a field if enum-type is provided, and that type must be specified if no enum-type attribute is provided.