After you
define a static enumeration in the model or
describe a dynamic enumeration based on a service operation that returns a list of values, you can associate that enumerations with a logical type defined in the model. The logical type would typically extend a base type
enumeration (or
integer enumeration if the values are integers), which is already mapped to appropriate data properties and selection controls.
In order to associate the logical type with a static or dynamic enumeration you need to do the following.
- Add enum element inside the type element of your logical type definition.
- Set the ref attribute to the name of a static or dynamic enumeration defined in the model.
After you link the logical type to an enumeration like that, any field or parameter using that type or any of its subtypes will be automatically configured to accept a value or a list of values from this enumeration.
The following example shows how the
marital status logical type is associated with the
marital status enumeration.
Code:
<types>
<type name="marital status" base="enumeration">
<enum ref="marital status"/>
</type>
</types>
<enums>
<enum name="marital status">
<item name="Single" value="S"/>
<item name="Married" value="M"/>
</enum>
</enums>