org.kuali.rice.kew.rule
Class AbstractIdRoleAttribute

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.AbstractIdRoleAttribute
All Implemented Interfaces:
Serializable, RoleAttribute, WorkflowAttribute, XmlConfiguredAttribute, GenericXMLRuleAttribute
Direct Known Subclasses:
NetworkIdRoleAttribute, PrincipalIdRoleAttribute, UniversityIdRoleAttribute, WorkgroupRoleAttribute

public abstract class AbstractIdRoleAttribute
extends AbstractRoleAttribute
implements GenericXMLRuleAttribute

A generic Role Attribute superclass that can be used to route to an ID. Can take as configuration the label to use for the element name in the XML. This allows for re-use of this component in different contexts.

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

Field Summary
private  String idValue
           
private  Map paramMap
           
private static String ROLE_NAME_LABEL
           
private  RuleAttribute ruleAttribute
           
private static String XML_ELEMENT_LABEL
           
 
Fields inherited from class org.kuali.rice.kew.rule.AbstractWorkflowAttribute
required
 
Constructor Summary
AbstractIdRoleAttribute()
           
 
Method Summary
protected abstract  String getAttributeElementName()
           
 String getDocContent()
          Generates XML containing the ID on this attribute.
protected abstract  String getIdName()
           
 String getIdValue()
           
 Map getParamMap()
           
 List<String> getQualifiedRoleNames(String roleName, DocumentContent documentContent)
          Returns qualified role names based on IDs in the XML.
protected  void readConfiguration()
          Reads any configured values in the XML of the RuleAttribute and adds them to the paramMap.
protected abstract  Id resolveId(String id)
           
 ResolvedQualifiedRole resolveQualifiedRole(RouteContext routeContext, String roleName, String qualifiedRole)
          Takes the given qualified role which contains an ID and returns a resolved role for the entity with that id.
 void setIdValue(String idValue)
           
 void setParamMap(Map paramMap)
           
 void setRuleAttribute(RuleAttribute ruleAttribute)
           
 
Methods inherited from class org.kuali.rice.kew.rule.AbstractRoleAttribute
isMatch
 
Methods inherited from class org.kuali.rice.kew.rule.AbstractWorkflowAttribute
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.WorkflowAttribute
getRoutingDataRows, getRuleExtensionValues, getRuleRows, isMatch, isRequired, setRequired, validateRoutingData, validateRuleData
 
Methods inherited from interface org.kuali.rice.kew.rule.RoleAttribute
getRoleNames
 

Field Detail

XML_ELEMENT_LABEL

private static final String XML_ELEMENT_LABEL
See Also:
Constant Field Values

ROLE_NAME_LABEL

private static final String ROLE_NAME_LABEL
See Also:
Constant Field Values

idValue

private String idValue

paramMap

private Map paramMap

ruleAttribute

private RuleAttribute ruleAttribute
Constructor Detail

AbstractIdRoleAttribute

public AbstractIdRoleAttribute()
Method Detail

getAttributeElementName

protected abstract String getAttributeElementName()

resolveId

protected abstract Id resolveId(String id)

getIdName

protected abstract String getIdName()

getQualifiedRoleNames

public List<String> getQualifiedRoleNames(String roleName,
                                          DocumentContent documentContent)
Returns qualified role names based on IDs in the XML. Each returned qualified Role contains a single ID.

Specified by:
getQualifiedRoleNames in interface RoleAttribute
Parameters:
roleName - the role name (without class prefix)
documentContent - the document content
See Also:
RoleAttribute.getQualifiedRoleNames(java.lang.String, org.kuali.rice.kew.routeheader.DocumentContent)

resolveQualifiedRole

public ResolvedQualifiedRole resolveQualifiedRole(RouteContext routeContext,
                                                  String roleName,
                                                  String qualifiedRole)
Takes the given qualified role which contains an ID and returns a resolved role for the entity with that id.

Specified by:
resolveQualifiedRole in interface RoleAttribute
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
See Also:
RoleAttribute.resolveQualifiedRole(org.kuali.rice.kew.engine.RouteContext, java.lang.String, java.lang.String)

getDocContent

public String getDocContent()
Generates XML containing the ID on this attribute.

Specified by:
getDocContent in interface WorkflowAttribute
Overrides:
getDocContent in class AbstractWorkflowAttribute
See Also:
AbstractWorkflowAttribute.getDocContent()

readConfiguration

protected void readConfiguration()
Reads any configured values in the XML of the RuleAttribute and adds them to the paramMap.


getIdValue

public String getIdValue()

setIdValue

public void setIdValue(String idValue)

getParamMap

public Map getParamMap()
Specified by:
getParamMap in interface GenericXMLRuleAttribute

setParamMap

public void setParamMap(Map paramMap)
Specified by:
setParamMap in interface GenericXMLRuleAttribute

setRuleAttribute

public void setRuleAttribute(RuleAttribute ruleAttribute)
Specified by:
setRuleAttribute in interface XmlConfiguredAttribute


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