Typelists and typecodes

In Guidewire PolicyCenter, a typelist represents a predefined set of possible values, with each separate value defined as a typecode. If Guidewire defines a typelist as final, it is not possible to add or delete typecodes from the typelist.

Typelist size recommendation

Limit the size of typelists to 2,000 typecodes. Because of Java's limit on the size of the class initialization method, PolicyCenter generates nested classes to implement typelists that have more than 2,048 typecodes. These nested classes affect how you refer to individual typecodes.

The maximum supported number of typecodes in a typelist is 8,192.

Note: For a SystemPermissionType typelist, the upper limit on the number of typecodes is 7,000 rather than 8,192.

If you have more than 2,048 typecodes in a typelist, PolicyCenter creates nested classes that can each contain an additional 2,048 typecodes. A new nested class is created if you create a new typecode and the currently used class contains 2,048 typecodes. To keep the number of nested classes in the base typelist class to a minimum, the entity code generator adjusts the nested classes as you add and subtract typecodes. These adjustments can change the path that you use to refer to a particular typecode.

Adhering to a soft limit of 2,000 typecodes provides some room to grow your typelist. This soft limit also aids in avoiding splitting the typelist into multiple typelists or a nested-class typelist. To adhere to this soft limit, consider breaking up large typelists by prominent characteristics of your business.
Important: If at all feasible, keep the size of your typelists under 2,048 typecodes, the maximum number of typecodes for a single-class typelist. A typelist with more than 2,048 typecodes uses nested classes. In this case, you must maintain proper references to the typecodes as their allocation among the nested classes changes. If you fail to maintain appropriate typecode references, PolicyCenter does not compile.

Using a lookup table instead of a typelist

If your PolicyCenter implementation requires a typelist with more than 2,048 typecodes, Guidewire strongly recommends that you use a lookup table, such as a custom entity type, instead of a typelist. By using a custom entity type, you can ensure referential integrity by using foreign keys to reference the codes in other entity types. If you add or remove codes from the list, you need to update only the lookup table. You do not need to change your code that accesses the codes through the lookup table.

If you use a database table to perform the look up, you can use a query to retrieve the codes.

Alternatively, you can use other lookup structures such as XML files.

Internal typecodes

Some typelists contain required internal typecodes that PolicyCenter references directly. Therefore, PolicyCenter requires that these typecodes exist. Guidewire Studio™ displays internal typecodes in non-editable cells so that you cannot edit or delete an internal typecode.

Localized typecodes

PolicyCenter supports localizing the individual typecodes in a typelist. See Localizing typecodes for more information.

Mapping typecodes to external system codes

See the following: