edu.sampleu.travel.workflow
Class AccountAttribute

java.lang.Object
  extended by org.kuali.rice.kew.rule.AbstractWorkflowAttribute
      extended by org.kuali.rice.kew.rule.AbstractRoleAttribute
          extended by edu.sampleu.travel.workflow.AccountAttribute
All Implemented Interfaces:
Serializable, RoleAttribute, WorkflowRuleAttribute

public class AccountAttribute
extends AbstractRoleAttribute

Resolves FO's using the accounts associated with the document XPath xpath = KualiWorkflowUtils.getXPath(documentContent.getDocument()); List qualifiers = new ArrayList(); NodeList accountNums = (NodeList)xstreamSafeEval(xpath, "//edu.sampleu.travel.workflow.bo.TravelAccount/number", documentContent.getDocument(), XPathConstants.NODESET); for (int i = 0; i < accountNums.getLength(); i++) { Node accountNum = accountNums.item(i); String accuntNumVal = accountNum.getNodeValue(); }

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.kuali.rice.kew.rule.AbstractWorkflowAttribute
required
 
Constructor Summary
AccountAttribute()
           
 
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.
static Object xstreamSafeEval(XPath xpath, String xpathExpression, Object item, QName returnType)
          This method will do a simple XPath.evaluate, while wrapping your xpathExpression with the xstreamSafe function.
 
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
 

Constructor Detail

AccountAttribute

public AccountAttribute()
Method Detail

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.

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

getRoleNames

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

Returns:
list of RoleNames this RoleAttribute supports

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

xstreamSafeEval

public static final Object xstreamSafeEval(XPath xpath,
                                           String xpathExpression,
                                           Object item,
                                           QName returnType)
This method will do a simple XPath.evaluate, while wrapping your xpathExpression with the xstreamSafe function. It assumes a String result, and will return such. If an XPathExpressionException is thrown, this will be re-thrown within a RuntimeException.

Parameters:
xpath - A correctly initialized XPath instance.
xpathExpression - Your XPath Expression that needs to be wrapped in an xstreamSafe wrapper and run.
item - The document contents you will be searching within.
Returns:
The string value of the xpath.evaluate().


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