org.kuali.rice.kew.rule
Class GenericRoleAttribute

java.lang.Object
  extended by org.kuali.rice.kew.rule.AbstractWorkflowAttribute
      extended by org.kuali.rice.kew.rule.GenericWorkflowAttribute
          extended by org.kuali.rice.kew.rule.GenericRoleAttribute
All Implemented Interfaces:
Serializable, RoleAttribute, WorkflowAttribute
Direct Known Subclasses:
ChannelReviewerRoleAttribute, EmployeeAttribute

public abstract class GenericRoleAttribute
extends GenericWorkflowAttribute
implements RoleAttribute

Generic base class that implements common functionality to simplify implementing a RoleAttribute. This includes a standard qualified role name String format and simplified template methods, as well as a generic attribute content model.

Control flow:

  1. getQualifiedRoleNames(String, DocumentContent)
    1. generateQualifiedRoleNames(String, DocumentContent)
      1. getRoleNameQualifiers(String, DocumentContent)
  2. resolveQualifiedRole(RouteContext, String, String)
    1. resolveQualifiedRole(RouteContext, QualifiedRoleName)
      1. resolveRecipients(RouteContext, QualifiedRoleName)
      2. getLabelForQualifiedRoleName(QualifiedRoleName)

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

Field Summary
 
Fields inherited from class org.kuali.rice.kew.rule.GenericWorkflowAttribute
attributeName, content, log
 
Fields inherited from class org.kuali.rice.kew.rule.AbstractWorkflowAttribute
required
 
Constructor Summary
GenericRoleAttribute()
           
GenericRoleAttribute(String uniqueName)
           
 
Method Summary
protected  List<QualifiedRoleName> generateQualifiedRoleNames(String roleName, DocumentContent documentContent)
          Template method responsible for producing a list of QualifiedRoleName objects.
protected  String getLabelForQualifiedRoleName(QualifiedRoleName qualifiedRoleName)
           
 List<String> getQualifiedRoleNames(String roleName, DocumentContent documentContent)
          Returns a String which represent the qualified role name of this role for the given roleName and docContent.
protected  List<String> getRoleNameQualifiers(String roleName, DocumentContent documentContent)
          Template method responsible for producing qualifiers for a role name
 boolean isMatch(DocumentContent docContent, List<RuleExtension> ruleExtensions)
          Returns true if this Attribute finds a match in the given DocContent.
protected  ResolvedQualifiedRole resolveQualifiedRole(RouteContext routeContext, QualifiedRoleName qualifiedRoleName)
          Template method that delegates to resolveRecipients(RouteContext, QualifiedRoleName) and {@link #getLabelForQualifiedRoleName(QualifiedRoleName)
 ResolvedQualifiedRole resolveQualifiedRole(RouteContext routeContext, String roleName, String qualifiedRoleName)
          Returns a List of Workflow Users which are members of the given qualified role.
protected  List<Id> resolveRecipients(RouteContext routeContext, QualifiedRoleName qualifiedRoleName)
          Template method for subclasses to implement
 
Methods inherited from class org.kuali.rice.kew.rule.GenericWorkflowAttribute
getDocContent, getProperties, getRuleExtensionValues, isMatch, isMatch, validateRoutingData, validateRuleData
 
Methods inherited from class org.kuali.rice.kew.rule.AbstractWorkflowAttribute
getIdFieldName, getLockFieldName, getRoutingDataRows, getRuleRows, isRequired, setRequired
 
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.RoleAttribute
getRoleNames
 

Constructor Detail

GenericRoleAttribute

public GenericRoleAttribute()

GenericRoleAttribute

public GenericRoleAttribute(String uniqueName)
Method Detail

isMatch

public boolean isMatch(DocumentContent docContent,
                       List<RuleExtension> ruleExtensions)
Description copied from interface: WorkflowAttribute
Returns true if this Attribute finds a match in the given DocContent. If true, the associated document will be routed to the users specifed by the UNF The isMatch method is responsible for determining whether content in a document matches content saved in workflow, thus determining whether to fire a rule or not. The isMatch method takes a DocumentContent object and a list of rule extension objects and returns a Boolean. The DocumentContent object contains the data in XML format that will be compared with the rules saved in workflow. Rule extension objects come from a potential rule that may match the document content on this eDoc. The potential rule is selected based on the Document Type and Rule Templates associated with this eDoc. Each rule extension object contains a list of rule extension value objects which have the data we will use in key value format to compare to the document content. The key will be determined by a unique string assigned by this attribute. The Value is determined when a rule is created and data is entered for the particular key. If a match is found, this method returns true and the eDoc will be routed based on this rule. If no match is found, the method returns false and the eDoc will not be routed based on this rule.

Specified by:
isMatch in interface WorkflowAttribute
Overrides:
isMatch in class GenericWorkflowAttribute

getQualifiedRoleNames

public List<String> getQualifiedRoleNames(String roleName,
                                          DocumentContent documentContent)
Description copied from interface: RoleAttribute
Returns a String which represent the qualified role name of this role for the given roleName and docContent.

Specified by:
getQualifiedRoleNames in interface RoleAttribute
Parameters:
roleName - the role name (without class prefix)
documentContent - the document content

generateQualifiedRoleNames

protected List<QualifiedRoleName> generateQualifiedRoleNames(String roleName,
                                                             DocumentContent documentContent)
Template method responsible for producing a list of QualifiedRoleName objects. Default implementation calls getRoleNameQualifiers(String, DocumentContent)


getRoleNameQualifiers

protected List<String> getRoleNameQualifiers(String roleName,
                                             DocumentContent documentContent)
Template method responsible for producing qualifiers for a role name


resolveQualifiedRole

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

Specified by:
resolveQualifiedRole in interface RoleAttribute
Parameters:
routeContext - the RouteContext
roleName - the roleName (without class prefix)
qualifiedRoleName - 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

resolveQualifiedRole

protected ResolvedQualifiedRole resolveQualifiedRole(RouteContext routeContext,
                                                     QualifiedRoleName qualifiedRoleName)
Template method that delegates to resolveRecipients(RouteContext, QualifiedRoleName) and {@link #getLabelForQualifiedRoleName(QualifiedRoleName)


getLabelForQualifiedRoleName

protected String getLabelForQualifiedRoleName(QualifiedRoleName qualifiedRoleName)

resolveRecipients

protected List<Id> resolveRecipients(RouteContext routeContext,
                                     QualifiedRoleName qualifiedRoleName)
Template method for subclasses to implement



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