Typekey fields

A typekey field is an entity field that PolicyCenter associates with a specific typelist in the user interface. The typelist determines the values that are possible for that field. Thus, the specified typelist limits the available field values to those defined in the typelist. (Or, if you filter the typelist, the field displays a subset of the typelist values.)

For a PolicyCenter field to use a typelist to set values requires the following:

  1. The typelist must exist. If it does not exist, then you must create it using Guidewire Studio.
  2. The typelist must exist as a <typekey> element on the entity that you use to populate the field. If the <typekey> element does not exist, then you must extend the entity and manually add the typekey.
  3. The PCF file that defines the screen that contains your typelist field must reference the entity that you use to populate the field.

This topic includes the following:

Example: Typekey field

The following example illustrates how to use the Priority typelist to set the priority of an activity that you create in PolicyCenter.

This example requires the following steps:

Step 1: Define the typelist in Studio

It is possible to set a priority on an activity, a value that indicates the priority of this activity with respect to other activities. In the base configuration, the Priority typelist includes the following typecodes:

  • High
  • Low
  • Normal
  • Urgent

You define both the Priority typelist and its typecodes (its valid values) through Guidewire Studio, through the Typelist editor. For information on using the Typelist editor, see Working with typelists in Studio.

After completing this step, complete Step 2: Add typekeys to the entity definition file.

Step 2: Add typekeys to the entity definition file

Before beginning this step, complete Step 1: Define the typelist in Studio.

For an entity to be able to access and use a typelist, you need to define a <typekey> element on that entity. Use the <typekey> element to specify the typelist in the entity metadata.

For example, in the base configuration, Guidewire declares a number of <typekey> elements on the Activity entity (Activity.eti), including the Priority typekey:

<entity entity="Activity" ... >
  ...
  <typekey default="task"
    desc="The class of the activity."
    name="ActivityClass"
    nullok="false"
    typelist="ActivityClass"/>
  <typekey desc="Priority of the activity with respect to other activities."
    name="Priority"
    nullok="false"
    typelist="Priority"/>
  <typekey default="open"
    desc="Status of the activity."
    exportable="false"
    name="Status"
    nullok="false"
    typelist="ActivityStatus"/>
  <typekey default="general"
    desc="Type of the activity."
    name="Type"
    nullok="false"
    typelist="ActivityType"/>
  <typekey desc="Validation level that this object passed (if any) before it was stored."
    exportable="false"
    name="ValidationLevel"
    typelist="ValidationLevel"/>
  ...
</entity>

Notice that the <typekey> element uses the following syntax:

<typekey desc="DescriptionString" name="FieldName" typelist="Typelist" />

After completing this step, complete Step 3: Reference the typelist in the PCF file.

See also

Step 3: Reference the typelist in the PCF file

Before beginning this task, complete Step 2: Add typekeys to the entity definition file.

Within Guidewire PolicyCenter, you can create a new activity. As you do so, you set a number of fields, including the priority for that activity. In order for PolicyCenter to render a Priority field on the screen, it must exist in the PCF file that PolicyCenter uses to render the screen.

Thus, as the following image illustrates, the PolicyCenter NewActivityDV PCF file contains a Priority field with a value of Activity.Priority:


NewActivityDV.pcf open in Guidewire Studio, with the Priority field and its value property highlighted.

After completing this step, complete Step 4: Update the data model.

See also

Step 4: Update the data model

Before beginning this task, complete Step 3: Reference the typelist in the PCF file.

Guidewire recommends that you regenerate the PolicyCenter Data Dictionary before proceeding. If you have made any mistakes in the previous steps, regenerating the Data Dictionary helps to identify those mistakes.

In any case, you need to stop and restart the application server before you can view your changes in the PolicyCenter interface. Restarting the application server forces PolicyCenter to upgrade the data model in the application database.