Dynamic assignment – required methods implementation
Any class that implements the DynamicUserAssignmentStrategy
interface (or the Group version) must provide implementations of the following
methods.
getCandidateUsers- Your implementation of the getCandidateUsers method must return the set of users to consider for assignment. (As elsewhere, the Group parameter establishes the root group to use to find the users under consideration. The Boolean includeSubGroups parameter indicates whether to include users belonging to descendant groups, or only those that are members of the parent group.)
getLocksForAssignable- The getLocksForAssignable method takes the set of
users returned by
getCandidateUsersand returns a set of entities that you must lock. By locked, Guidewire means that the current server node obtains the database rows corresponding to those entities, which must be persistent entities. Any other server nodes that needs to access these rows must wait until the assignment process finishes. Round-robin and dynamic assignment require this sort of locking to mandate that multiple nodes do not perform simultaneous assignments. This ensures that multiple nodes do not perform simultaneous assignments and assign multiple activities (for example) to the same person, instead of progressing through the set of candidates. findUserToAssign- Your implementation of the findUserToAssign method
must perform the actual assignment work, using the two sets of entities
returned by the previous two methods. (That is, it takes a set of users
and the set of entities for which you need to lock the database rows and
performs that actual assignment.) This method must do the following:
- It makes any necessary state modifications (such as updating counters, and similar operations).
- It returns the GroupUser entity representing the selected User and Group.
rollbackAssignment- Guidewire provides the final two API methods to deal with situations in which, after the assignment flow, some problem in the bundle commit blocks the assignment. This can happen, for example, if a validation rule caused a database rollback. However, at this point, PolicyCenter has already updated the locked objects and committed the objects to the database (as in step 6 in the assignment flow).
getAssignmentToken- If the rollbackAssignment method returns
false, then PolicyCenter calls the getAssignmentToken method. Your implementation of this method must return some object that you can use to preserve the results of the assignment operation.
