Creating a bundle for a specific PolicyCenter user

The gw.transaction.Transaction class provides a signature of the runWithNewBundle method to associate a specific user with the newly created bundle. You use this method signature in contexts in which there is no built-in user context, such in the startable plugins feature. The method signature is:

gw.transaction.Transaction.runWithNewBundle(\ bundle -> YOUR_BLOCK_BODY, user)

For the second argument to the method, you can pass either a User entity instance or the user name as a String.

Guidewire strongly recommends that you do not use the Guidewire sys user (System User), or any other default user, to create a new bundle.