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 | 0 | public class RolePokerQueueImpl implements RolePokerQueue { |
30 | |
|
31 | |
@Override |
32 | |
public void reResolveQualifiedRole(String documentId, String roleName, String qualifiedRoleNameLabel) { |
33 | 0 | if (StringUtils.isBlank(documentId)) { |
34 | 0 | throw new RiceIllegalArgumentException("documentId is null or blank"); |
35 | |
} |
36 | 0 | if (StringUtils.isBlank(roleName)) { |
37 | 0 | throw new RiceIllegalArgumentException("roleName is null or blank"); |
38 | |
} |
39 | |
|
40 | 0 | KEWServiceLocator.getRouteHeaderService().lockRouteHeader(documentId, true); |
41 | 0 | DocumentRouteHeaderValue document = KEWServiceLocator.getRouteHeaderService().getRouteHeader(documentId); |
42 | 0 | if (qualifiedRoleNameLabel == null) { |
43 | 0 | KEWServiceLocator.getRoleService().reResolveRole(document, roleName); |
44 | |
} else { |
45 | 0 | KEWServiceLocator.getRoleService().reResolveQualifiedRole(document, roleName, qualifiedRoleNameLabel); |
46 | |
} |
47 | 0 | } |
48 | |
|
49 | |
@Override |
50 | |
public void reResolveRole(String documentId, String roleName) { |
51 | 0 | reResolveQualifiedRole(documentId, roleName, null); |
52 | 0 | } |
53 | |
} |