org.kuali.rice.kew.rule
Interface RoleAttribute

All Superinterfaces:
Serializable, WorkflowRuleAttribute
All Known Implementing Classes:
AbstractIdRoleAttribute, AbstractRoleAttribute, AccountAttribute, ChannelReviewerRoleAttribute, EmployeeAttribute, GenericRoleAttribute, InitiatorRoleAttribute, NetworkIdRoleAttribute, PrincipalIdRoleAttribute, RoutedByUserRoleAttribute, UniversityIdRoleAttribute, UnqualifiedRoleAttribute, WorkgroupRoleAttribute

public interface RoleAttribute
extends WorkflowRuleAttribute

A special type of attribute that is used exclusively for resolving abstract roles to concrete responsibilities (users and groups). A RoleAttribute provides resolution for a set of abstract "role" names. These are published via the getRoleNames() method, which returns a list of RoleName, which is a combination of class name (attribute implementation class), abstract role name, and optional label and return url (DOCME: what is return url used for?).

RoleAttribute lifecycle:

  1. A RoleAttribute is defined on a Rule, via the role element, with the syntax: fully qualified class name!abstract role name. E.g.:
    <role>edu.whatever.attribute.SomeAttribute!RoleName</role>
  2. When the <role> element is parsed, the Rule's "responsibility" is set to the role element value and the responsibility is marked to indicate that it is a role ("R", KewApiConstants.RULE_RESPONSIBILITY_ROLE_ID)
  3. When a Rule that is configured with a Role responsibility is fired, getQualifiedRoleNames(String, DocumentContent) is called to return a list of "qualified" role names. Qualified role names are role names which have been qualified with some relevant contextual information (e.g. from the document) that is useful for subsequent responsibility resolution.
  4. resolveQualifiedRole(RouteContext, String, String) is immediately called for each of the qualified role names returned in the previous step, and it returns a ResolvedQualifiedRole containing the list of concrete recipients (Ids).
  5. (UnqualifiedRoleAttribute base class can be used to simplify this two-step process)

Relationship to WorkflowAttribute: all RoleAttribute implementations are also WorkflowAttribute implementations (is this true? should RoleAttribute extend WorkflowAttribute in that case?)

Methods of WorkflowAttribute interface fulfilled by RoleAttribute:

  1. ??
Methods of WorkflowAttribute interface not relevant to RoleAttribute:
  1. WorkflowRuleAttribute.isMatch(DocumentContent, List)
  2. ??

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

Method Summary
 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.
 List<RoleName> getRoleNames()
          List of RoleNames this RoleAttribute supports
 ResolvedQualifiedRole resolveQualifiedRole(RouteContext routeContext, String roleName, String qualifiedRole)
          Returns a List of Workflow Users which are members of the given qualified role.
 
Methods inherited from interface org.kuali.rice.kew.rule.WorkflowRuleAttribute
getDocContent, getRoutingDataRows, getRuleExtensionValues, getRuleRows, isMatch, isRequired, setRequired, validateRoutingData, validateRuleData
 

Method Detail

getRoleNames

List<RoleName> getRoleNames()
List of RoleNames this RoleAttribute supports

Returns:
list of RoleNames this RoleAttribute supports

getQualifiedRoleNames

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.

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

resolveQualifiedRole

ResolvedQualifiedRole resolveQualifiedRole(RouteContext routeContext,
                                           String roleName,
                                           String qualifiedRole)
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 getQualifiedRoleNames(String, DocumentContent) method
Returns:
ResolvedQualifiedRole containing recipients, role label (most likely the roleName), and an annotation


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