Map the new entity and array extensions in ClaimCenter

After creating new Contact entities and array extensions, you need to map them from ClaimCenter to ContactManager.

Before you begin

Complete Add the new array to the Contact entity in ClaimCenter.

About this task

In this step, you add the new array reference and the entity it references to the ContactMapper class in ClaimCenter.

For more information on this class, see ContactMapper class. Additionally, for more information on the last step in this topic, see ContactManager link IDs and comparison to other IDs.

Procedure

  1. In Guidewire Studio™ for ClaimCenter, press Ctrl+N and search for the class ContactMapper, and then double-click the ab1000 version of this class in the search results to open it in the editor.
  2. Find the Mappings method, which has the following declaration:
    override property get Mappings() : Set<CCPropertyMapping>
    In this method, you will add a method for Contact array reference ContactServiceArea and methods that map the elements of the array, ContactServiceState.
  3. At the end of the method, add a comma to the last line of code so you can add more code. For example:
    .withEntityBeanBlock( \ lm, bp -> populateBeanFromXml(bp)),
  4. After this last line of code, add an arrayMapping method for Contact#ContactServiceArea, preceded with a comment for this part of the Mappings method:
    //ContactServiceState mapping
    arrayMapping(Contact#ContactServiceArea),
  5. Add fieldMapping methods for the elements of the ContactServiceState entity, which the ABContact array reference refers to:
    fieldMapping(ContactServiceState#AddressBookUID)
      .withABName(MappingConstants.LINK_ID),
    fieldMapping(ContactServiceState#PublicID)
      .withMappingDirection(TO_XML)
      .withABName(MappingConstants.EXTERNAL_PUBLIC_ID),
    fieldMapping(ContactServiceState#ServiceState)

    This code maps between the following ContactServiceState fields in ClaimCenter and ContactManager.

    ClaimCenter ContactManager Direction
    AddressBookUID LINK_ID Both ways
    PublicID EXTERNAL_PUBLIC_ID From ClaimCenter to ContactManager only
    ServiceState ServiceState Both ways

What to do next

Add support for service state searches to the Address Book