1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kew.impl.action;
17
18 import org.apache.commons.lang.StringUtils;
19 import org.kuali.rice.core.api.exception.RiceIllegalArgumentException;
20 import org.kuali.rice.kew.api.action.RolePokerQueue;
21 import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue;
22 import org.kuali.rice.kew.service.KEWServiceLocator;
23
24
25
26
27
28
29 public class RolePokerQueueImpl implements RolePokerQueue {
30
31 @Override
32 public void reResolveQualifiedRole(String documentId, String roleName, String qualifiedRoleNameLabel) {
33 if (StringUtils.isBlank(documentId)) {
34 throw new RiceIllegalArgumentException("documentId is null or blank");
35 }
36 if (StringUtils.isBlank(roleName)) {
37 throw new RiceIllegalArgumentException("roleName is null or blank");
38 }
39
40 KEWServiceLocator.getRouteHeaderService().lockRouteHeader(documentId);
41 DocumentRouteHeaderValue document = KEWServiceLocator.getRouteHeaderService().getRouteHeader(documentId);
42 if (qualifiedRoleNameLabel == null) {
43 KEWServiceLocator.getRoleService().reResolveRole(document, roleName);
44 } else {
45 KEWServiceLocator.getRoleService().reResolveQualifiedRole(document, roleName, qualifiedRoleNameLabel);
46 }
47 }
48
49 @Override
50 public void reResolveRole(String documentId, String roleName) {
51 reResolveQualifiedRole(documentId, roleName, null);
52 }
53 }