1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kew.service.impl; |
17 | |
|
18 | |
import org.apache.commons.lang.StringUtils; |
19 | |
import org.kuali.rice.kim.api.KimConstants; |
20 | |
import org.kuali.rice.kim.api.responsibility.Responsibility; |
21 | |
import org.kuali.rice.kim.framework.responsibility.ResponsibilityTypeService; |
22 | |
|
23 | |
import java.util.ArrayList; |
24 | |
import java.util.Collections; |
25 | |
import java.util.Iterator; |
26 | |
import java.util.List; |
27 | |
import java.util.Map; |
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | 0 | public class ReviewResponsibilityTypeServiceImpl extends DocumentTypeResponsibilityTypeServiceImpl implements ResponsibilityTypeService { |
33 | |
{ |
34 | 0 | exactMatchStringAttributeName = KimConstants.AttributeConstants.ROUTE_NODE_NAME; |
35 | 0 | } |
36 | |
|
37 | |
@Override |
38 | |
protected List<String> getRequiredAttributes() { |
39 | 0 | final List<String> attrs = new ArrayList<String>(super.getRequiredAttributes()); |
40 | 0 | attrs.add(KimConstants.AttributeConstants.ROUTE_NODE_NAME); |
41 | 0 | return Collections.unmodifiableList(attrs); |
42 | |
} |
43 | |
|
44 | |
@Override |
45 | |
protected List<Responsibility> performResponsibilityMatches( |
46 | |
Map<String, String> requestedDetails, |
47 | |
List<Responsibility> responsibilitiesList) { |
48 | |
|
49 | 0 | List<Responsibility> baseMatches = super.performResponsibilityMatches(requestedDetails, |
50 | |
responsibilitiesList); |
51 | |
|
52 | |
|
53 | |
|
54 | |
|
55 | 0 | Iterator<Responsibility> respIter = baseMatches.iterator(); |
56 | 0 | while ( respIter.hasNext() ) { |
57 | 0 | Map<String, String> respDetails = respIter.next().getAttributes(); |
58 | 0 | if ( respDetails.containsKey( KimConstants.AttributeConstants.QUALIFIER_RESOLVER_PROVIDED_IDENTIFIER ) && StringUtils.isNotBlank( respDetails.get(KimConstants.AttributeConstants.QUALIFIER_RESOLVER_PROVIDED_IDENTIFIER) ) ) { |
59 | 0 | if ( !requestedDetails.containsKey( KimConstants.AttributeConstants.QUALIFIER_RESOLVER_PROVIDED_IDENTIFIER ) |
60 | |
|| !StringUtils.equals( respDetails.get(KimConstants.AttributeConstants.QUALIFIER_RESOLVER_PROVIDED_IDENTIFIER) |
61 | |
, requestedDetails.get(KimConstants.AttributeConstants.QUALIFIER_RESOLVER_PROVIDED_IDENTIFIER))) { |
62 | 0 | respIter.remove(); |
63 | |
} |
64 | |
} |
65 | 0 | } |
66 | 0 | return baseMatches; |
67 | |
} |
68 | |
} |