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.UserTypeto Other - Setting the value of
User.Organizationto 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
-
Set the
User.ExternalUserproperty to the specified value. - Retrieve the value of Current User that the bundle specifies.
- 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.
-
If the User is an external user:
- Remove all the carrier's internal roles for the User, meaning all roles
for which
Role.isCarrierInternalRoleis true. - Set the User's organization to the Current User's organization.
- Remove all the carrier's internal roles for the User, meaning all roles
for which
- 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.
-
If the User's organization is not a carrier, set the
User.UseProducerCodeSecurityproperty to true. -
If the value of
User.UseOrgAddressis true, set the user's contact address information to the organization address. -
Set the
User.UserTypeproperty to Other.
