org.kuali.rice.kew.rule
Class UnqualifiedRoleAttribute

java.lang.Object
  extended by org.kuali.rice.kew.rule.AbstractWorkflowAttribute
      extended by org.kuali.rice.kew.rule.AbstractRoleAttribute
          extended by org.kuali.rice.kew.rule.UnqualifiedRoleAttribute
All Implemented Interfaces:
Serializable, RoleAttribute, WorkflowRuleAttribute
Direct Known Subclasses:
InitiatorRoleAttribute, RoutedByUserRoleAttribute

public abstract class UnqualifiedRoleAttribute
extends AbstractRoleAttribute

A simple base RoleAttribute implementation for roles that do not need to be qualified prior to resolution.

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
Serialized Form

Field Summary
protected  List<RoleName> roles
           
 
Fields inherited from class org.kuali.rice.kew.rule.AbstractWorkflowAttribute
required
 
Constructor Summary
UnqualifiedRoleAttribute()
          No-arg constructor for subclasses that will override getRoleNames() to provide their own roles list
UnqualifiedRoleAttribute(List<RoleName> roles)
          Constructor for subclasses that can provide a role list at construction time
 
Method Summary
 List<String> getQualifiedRoleNames(String roleName, DocumentContent documentContent)
          Returns a List containing only the roleName parameter; i.e.
 List<RoleName> getRoleNames()
          List of RoleNames this RoleAttribute supports
protected  boolean isValidRoleName(String roleName)
           
protected  String parseRoleNameFromClassAndRole(String classAndRole)
          Helper method for parsing the actual role name out from the class/rolename combination as Role class combines the two and does expose the original role name
 ResolvedQualifiedRole resolveQualifiedRole(RouteContext routeContext, String roleName, String qualifiedRole)
          Returns a List of Workflow Users which are members of the given qualified role.
protected abstract  ResolvedQualifiedRole resolveRole(RouteContext routeContext, String roleName)
          Template method for subclasses to implement
 
Methods inherited from class org.kuali.rice.kew.rule.AbstractRoleAttribute
isMatch
 
Methods inherited from class org.kuali.rice.kew.rule.AbstractWorkflowAttribute
getDocContent, getIdFieldName, getLockFieldName, getRoutingDataRows, getRuleExtensionValues, getRuleRows, isRequired, setRequired, validateRoutingData, validateRuleData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.kuali.rice.kew.rule.WorkflowRuleAttribute
getDocContent, getRoutingDataRows, getRuleExtensionValues, getRuleRows, isRequired, setRequired, validateRoutingData, validateRuleData
 

Field Detail

roles

protected List<RoleName> roles
Constructor Detail

UnqualifiedRoleAttribute

public UnqualifiedRoleAttribute()
No-arg constructor for subclasses that will override getRoleNames() to provide their own roles list


UnqualifiedRoleAttribute

public UnqualifiedRoleAttribute(List<RoleName> roles)
Constructor for subclasses that can provide a role list at construction time

Method Detail

getRoleNames

public List<RoleName> getRoleNames()
Description copied from interface: RoleAttribute
List of RoleNames this RoleAttribute supports

Returns:
list of RoleNames this RoleAttribute supports

getQualifiedRoleNames

public List<String> getQualifiedRoleNames(String roleName,
                                          DocumentContent documentContent)
Returns a List containing only the roleName parameter; i.e. no qualification occurs

Parameters:
roleName - the role name (without class prefix)
documentContent - the document content

parseRoleNameFromClassAndRole

protected String parseRoleNameFromClassAndRole(String classAndRole)
Helper method for parsing the actual role name out from the class/rolename combination as Role class combines the two and does expose the original role name

Parameters:
classAndRole - the class and role string (e.g. org.blah.MyRoleAttribute!SOME_ROLE_NAME)
Returns:
the role name portion of the class and role string (e.g. SOME_ROLE_NAME);

isValidRoleName

protected boolean isValidRoleName(String roleName)
Parameters:
roleName - roleName to test
Returns:
whether the roleName specifies a role that this attribute can resolve

resolveQualifiedRole

public ResolvedQualifiedRole resolveQualifiedRole(RouteContext routeContext,
                                                  String roleName,
                                                  String qualifiedRole)
Description copied from interface: RoleAttribute
Returns a List of Workflow Users which are members of the given qualified role.

Parameters:
routeContext - the RouteContext
roleName - the roleName (without class prefix)
qualifiedRole - one of the the qualified role names returned from the RoleAttribute.getQualifiedRoleNames(String, DocumentContent) method
Returns:
ResolvedQualifiedRole containing recipients, role label (most likely the roleName), and an annotation

resolveRole

protected abstract ResolvedQualifiedRole resolveRole(RouteContext routeContext,
                                                     String roleName)
Template method for subclasses to implement

Parameters:
routeContext - the RouteContext
roleName - the role name
Returns:
a ResolvedQualifiedRole


Copyright © 2005-2011 The Kuali Foundation. All Rights Reserved.