Managing user entity updates in batch processing

It is possible for an update to the User entity to null out additional fields on the entity if the executing user is a PolicyCenter System user. This situation can arise during batch processing or during the execution of code in the Studio Gosu tester. For example, if the code sets the value of User.ExternalUser to true, PolicyCenter also changes a number of other fields within the entity automatically. These additional changes include:

  • Setting the value of User.UserType to Other
  • Setting the value of User.Organization to null
  • Setting the Address fields on the associated Contact entity to null

Specify a Current User that belongs to the same organization as the User executing the code so that the User inherits the organization information of the Current User. The Current User must be an external user as well.

Set the external user field in a batch process

About this task

If you need to set the User.ExternalUser field in a batch process, Guidewire recommends that you take the following steps to manage this process.

Procedure

  1. Set the User.ExternalUser property to the specified value.
  2. Retrieve the value of Current User that the bundle specifies.
  3. If the User is not an external user, use the existing organization to which the user belongs. In other words, do not clear this field.
  4. If the User is an external user:
    • Remove all the carrier's internal roles for the User, meaning all roles for which Role.isCarrierInternalRole is true.
    • Set the User's organization to the Current User's organization.
  5. If the User’s organization is not the same as the Current User’s organization, remove all the groups and producer codes associated with the User.
  6. If the User's organization is not a carrier, set the User.UseProducerCodeSecurity property to true.
  7. If the value of User.UseOrgAddress is true, set the user's contact address information to the organization address.
  8. Set the User.UserType property to Other.