Defining field as syncable on the policy contact role

Complete the step Defining the revisioned field on the policy audit contact before you perform this step.

Define the field as syncable on the policy contact role by adding it to the ACCOUNT_SYNCED_FIELDS variable in the gw.contact.PolicyAuditContactAccountSyncableImpl Gosu class.

Because this is a new contact role, you must first create the account syncable implementation class. The code is based on the class for the policy driver contact role: gw.lob.pa.contact.PolicyDriverAccountSyncableImpl.

In the following illustration, the circled number 3 shows the ACCOUNT_SYNCED_FIELDS variable on the new PolicyAuditContactAccountSyncableImpl class. Because all revisioned contact information is effective dated, all revisioned fields on contact must extend the AbstractDateAwareAccountSyncableImpl class. For more information, see Revisioning contact information in policies.



In this class, when you get the AccountSyncedFields property, the code returns an array. The array includes the names of the synchronized fields in the current class and in all syncable classes that it extends. Therefore, when you get the AccountSyncedFields property, the array contains AuditLicenseNumber, CompanyName, FirstName, LastName, DateOfBirth, and MaritalStatus.

Define account syncable implementation class

Procedure

  1. In Studio, navigate to the gw.contact package.
  2. Right-click contact, select New > Gosu Class and enter PolicyAuditContactAccountSyncableImpl for the class name and click OK.

What to do next

Define revisioned field as syncable on policy contact role

Define revisioned field as syncable on policy contact role

Before you begin

Define account syncable implementation class

Procedure

  1. In Studio, open gw.contact.PolicyAuditContactAccountSyncableImpl.gs.
  2. Add the following code which is based on PolicyDriverAccountSyncableImpl.gs.
    uses gw.contact.AbstractPolicyContactRoleAccountSyncableImpl
    uses gw.account.AccountContactRoleToPolicyContactRoleSyncedField
    uses com.google.common.collect.ImmutableSet
    uses gw.api.domain.account.AccountSyncedField
    uses gw.api.domain.account.AccountSyncable
    uses java.util.Set
    
     /**
     * Implementation that handles AuditContact account syncing behavior.
     */
    @Export
    class PolicyAuditContactAccountSyncableImpl extends
        AbstractPolicyContactRoleAccountSyncableImpl<PolicyAuditContact_Ext> {
    construct(accountSyncable: PolicyAuditContact_Ext) {
        super(accountSyncable)
      }
      static final var ACCOUNT_SYNCED_FIELDS = ImmutableSet.copyOf(
          AbstractPolicyContactRoleAccountSyncableImpl.AccountSyncedFieldsInternal.union(
          {
          AccountContactRoleToPolicyContactRoleSyncedField.AuditLicenseNumber})
        )
    
       protected static property get AccountSyncedFieldsInternal() : 
            Set<AccountSyncedField<AccountSyncable, Object >> {  
        // provided so subclasses can extend this list
        return ACCOUNT_SYNCED_FIELDS
      }
      
      override property get AccountSyncedFields() : Set<AccountSyncedField<AccountSyncable, Object >> {  
        // must override to ensure that we call the correct static AccountSyncedFieldsInternal property
        return AccountSyncedFieldsInternal
      }
    }
    Note: You define AuditLicenseNumber in the next step.

What to do next

Define the field as syncable on the account contact role