org.kuali.rice.kew.role
Class XPathQualifierResolver

java.lang.Object
  extended by org.kuali.rice.kew.role.XPathQualifierResolver
All Implemented Interfaces:
QualifierResolver, XmlConfiguredAttribute

public class XPathQualifierResolver
extends Object
implements QualifierResolver, XmlConfiguredAttribute

Resolves qualifiers based on XPath configuration in the resolver's attribute.

An example of the xml processed by this attribute follows:

 
   /xmlData/chartOrg
   
     ./chart
   
   
     ./org
   
 
 

There are 2 different types of qualifier resolvers, those that resolve compound attribute sets and those that resolve simple attribute sets. A simple attribute set is one which includes only a single "qualifier" specification. The example above is compound because it includes both chart and org.

When dealing with compound attribute sets, the baseXPathExpression is used to define grouping for these compound sets. It is therefore required that inside each resulting element retrieved from the baseXPathExpression, there is only a single instance of each qualifier. If this is not the case, an error will be thrown. For the example above, the following XML would be evaluated successfully:

 
   
     BL
     BUS
   
   
     IN
     MED
   
 
 

This would return 2 attributes sets, each with a chart and org in it. The following XML would cause the XPathQualifierResolver to throw an exception during processing.

 
   
     BL
     BUS
     IN
     MED
   
 
 

In this case the resolver has no knowledge of how to group chart and org together. What follows is an example of a resolver using a simple attribute set:

 
   /xmlData/accountNumbers
   
     ./accountNumber
   
 
 

In this example, the following XML would return a List containing an Map for each account number when resolved.

 
   
     12345
     54321
     102030
     302010
   
 
 
 

The baseXPathExpression is optional and defaults to the root of the document if not specified.

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

Constructor Summary
XPathQualifierResolver()
           
 
Method Summary
protected  void handleCompoundMap(Node baseNode, List<Map<String,String>> maps, org.kuali.rice.kew.role.XPathQualifierResolver.ResolverConfig config, XPath xPath)
           
protected  void handleSimpleMap(Node baseNode, List<Map<String,String>> maps, org.kuali.rice.kew.role.XPathQualifierResolver.ResolverConfig config, XPath xPath)
           
protected  org.kuali.rice.kew.role.XPathQualifierResolver.ResolverConfig parseResolverConfig()
           
 List<Map<String,String>> resolve(RouteContext context)
           
 void setExtensionDefinition(ExtensionDefinition ruleAttribute)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XPathQualifierResolver

public XPathQualifierResolver()
Method Detail

resolve

public List<Map<String,String>> resolve(RouteContext context)
Specified by:
resolve in interface QualifierResolver

handleCompoundMap

protected void handleCompoundMap(Node baseNode,
                                 List<Map<String,String>> maps,
                                 org.kuali.rice.kew.role.XPathQualifierResolver.ResolverConfig config,
                                 XPath xPath)
                          throws XPathExpressionException
Throws:
XPathExpressionException

handleSimpleMap

protected void handleSimpleMap(Node baseNode,
                               List<Map<String,String>> maps,
                               org.kuali.rice.kew.role.XPathQualifierResolver.ResolverConfig config,
                               XPath xPath)
                        throws XPathExpressionException
Throws:
XPathExpressionException

parseResolverConfig

protected org.kuali.rice.kew.role.XPathQualifierResolver.ResolverConfig parseResolverConfig()

setExtensionDefinition

public void setExtensionDefinition(ExtensionDefinition ruleAttribute)
Specified by:
setExtensionDefinition in interface XmlConfiguredAttribute


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