Defining a subtype

A subtype is an entity that you base on another entity (its supertype). The subtype has all of the fields and elements of its supertype, and it can also have additional ones. You can also create subtypes of subtypes, with no limit to the depth of the hierarchy.

PolicyCenter does not associate a unique database table with a subtype. Instead, the application stores all subtypes in the table of its supertype. The supertype table includes a subtype column. The subtype column stores the type values for each subtype. PolicyCenter uses this column to resolve a subtype.

You define a subtype using the <subtype> element. You must specify certain attributes of the subtype, such as its name and its supertype (the entity on which PolicyCenter bases the subtype entity). For a description of required and optional attributes, see <subtype> elements and related data object types.

Within the <subtype> definition, you must define its fields and other elements. For a description of the elements you can include, see Data entity subelements.

Example

This example defines an Inspector_Ext entity as a subtype of Person. The Inspector_Ext entity includes a field for the inspector’s business license. To create the Inspector_Ext.eti file
  1. In Studio, navigate to configuration > config > Extensions > Entity.
  2. Right-click Entity, and then click New > Entity.
  3. In the Entity text box, type Inspector_Ext.
  4. In the Entity Type drop-down list, click subtype.
  5. In the Supertype box, type Person.
  6. Click OK.
  7. In the Field drop-down list, click column.
  8. Set the following properties for the new column:
    • name: InspectorLicense_Ext
    • type: varchar
    • desc: Inspector's business license number
  9. In the Field drop-down list, click columnParam.
  10. Set the following properties for the new column parameter:
    • name: size
    • value: 30

Note that while Inspector_Ext is subtype of Person, Person, itself, is a subtype of Contact. PolicyCenter automatically adds the new Inspector_Ext type to the Contact typelist. This is true, even though PolicyCenter marks the Contact typelist as final.

To see this change:

  • To see this change in the PolicyCenter Data Dictionary, you must restart the application server.
  • To see this change in the Contact typelist in Studio, you must restart Studio.