| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.kuali.rice.kew.rule; |
| 17 | |
|
| 18 | |
import java.util.ArrayList; |
| 19 | |
import java.util.Collections; |
| 20 | |
import java.util.List; |
| 21 | |
|
| 22 | |
import org.kuali.rice.kew.api.identity.PrincipalId; |
| 23 | |
import org.kuali.rice.kew.api.rule.RoleName; |
| 24 | |
import org.kuali.rice.kew.engine.RouteContext; |
| 25 | |
|
| 26 | |
|
| 27 | |
|
| 28 | |
|
| 29 | |
|
| 30 | |
|
| 31 | |
|
| 32 | |
public class InitiatorRoleAttribute extends UnqualifiedRoleAttribute { |
| 33 | |
private static final String INITIATOR_ROLE_KEY = "INITIATOR"; |
| 34 | |
private static final String INITIATOR_ROLE_LABEL = "Initiator"; |
| 35 | |
|
| 36 | 0 | private static final RoleName ROLE = new RoleName(InitiatorRoleAttribute.class.getName(), INITIATOR_ROLE_KEY, INITIATOR_ROLE_LABEL); |
| 37 | |
private static final List<RoleName> ROLES; |
| 38 | |
static { |
| 39 | 0 | ArrayList<RoleName> roles = new ArrayList<RoleName>(1); |
| 40 | 0 | roles.add(ROLE); |
| 41 | 0 | ROLES = Collections.unmodifiableList(roles); |
| 42 | 0 | } |
| 43 | |
|
| 44 | |
public InitiatorRoleAttribute() { |
| 45 | 0 | super(ROLES); |
| 46 | 0 | } |
| 47 | |
|
| 48 | |
public ResolvedQualifiedRole resolveRole(RouteContext routeContext, String roleName) { |
| 49 | 0 | List members = new ArrayList(1); |
| 50 | 0 | members.add(new PrincipalId(routeContext.getDocument().getInitiatorWorkflowId())); |
| 51 | 0 | return new ResolvedQualifiedRole(INITIATOR_ROLE_LABEL, members); |
| 52 | |
} |
| 53 | |
} |