org.kuali.rice.kew.engine.node.hierarchyrouting
Class SimpleHierarchyProvider

java.lang.Object
  extended by org.kuali.rice.kew.engine.node.hierarchyrouting.SimpleHierarchyProvider
All Implemented Interfaces:
HierarchyProvider

public class SimpleHierarchyProvider
extends Object
implements HierarchyProvider

A simple hierarchy provider that provides hierarchy based on doc content

 stop id="..." recipient="..." type="..."
     stop ...
     stop ...
       stop ...
 

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

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.kuali.rice.kew.engine.node.hierarchyrouting.HierarchyProvider
HierarchyProvider.Stop
 
Constructor Summary
SimpleHierarchyProvider()
           
 
Method Summary
 void configureRequestNode(RouteNodeInstance hierarchyNodeInstance, RouteNode node)
           
 boolean equals(HierarchyProvider.Stop a, HierarchyProvider.Stop b)
           
protected  Element findRootStop(Element e)
           
 List<HierarchyProvider.Stop> getLeafStops(RouteContext context)
           
 HierarchyProvider.Stop getParent(HierarchyProvider.Stop stop)
           
 HierarchyProvider.Stop getStop(RouteNodeInstance nodeInstance)
           
 HierarchyProvider.Stop getStopByIdentifier(String stopId)
           
 String getStopIdentifier(HierarchyProvider.Stop stop)
           
 boolean hasStop(RouteNodeInstance nodeInstance)
           
 void init(Element element)
          This constructor can be used in tests
 void init(RouteNodeInstance nodeInstance, RouteContext context)
           
 boolean isRoot(HierarchyProvider.Stop stop)
           
protected  org.kuali.rice.kew.engine.node.hierarchyrouting.SimpleHierarchyProvider.SimpleStop parseStop(Element e)
          Parses stop info from a stop element
protected  org.kuali.rice.kew.engine.node.hierarchyrouting.SimpleHierarchyProvider.SimpleStop parseStops(Element e, org.kuali.rice.kew.engine.node.hierarchyrouting.SimpleHierarchyProvider.SimpleStop parent)
          Parses a hierarchy of stop elements recursively, and populates the stops Map.
 void setStop(RouteNodeInstance requestNodeInstance, HierarchyProvider.Stop stop)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleHierarchyProvider

public SimpleHierarchyProvider()
Method Detail

init

public void init(RouteNodeInstance nodeInstance,
                 RouteContext context)
Specified by:
init in interface HierarchyProvider

init

public void init(Element element)
This constructor can be used in tests

Parameters:
element - the root Element of the hierarchy XML

findRootStop

protected Element findRootStop(Element e)
Parameters:
e - the element at which to start the search
Returns:
the first stop element encountered
Throws:
RuntimeException - if no stop elements were encountered

parseStops

protected org.kuali.rice.kew.engine.node.hierarchyrouting.SimpleHierarchyProvider.SimpleStop parseStops(Element e,
                                                                                                        org.kuali.rice.kew.engine.node.hierarchyrouting.SimpleHierarchyProvider.SimpleStop parent)
Parses a hierarchy of stop elements recursively, and populates the stops Map.

Parameters:
e - a stop element
parent - the parent of the current element (if any)
Returns:
the SimpleStop instance for the initial element

parseStop

protected org.kuali.rice.kew.engine.node.hierarchyrouting.SimpleHierarchyProvider.SimpleStop parseStop(Element e)
Parses stop info from a stop element

Parameters:
e - the stop element
Returns:
a SimpleStop initialized with attribute/property information

getLeafStops

public List<HierarchyProvider.Stop> getLeafStops(RouteContext context)
Specified by:
getLeafStops in interface HierarchyProvider

getStopByIdentifier

public HierarchyProvider.Stop getStopByIdentifier(String stopId)
Specified by:
getStopByIdentifier in interface HierarchyProvider

getStopIdentifier

public String getStopIdentifier(HierarchyProvider.Stop stop)
Specified by:
getStopIdentifier in interface HierarchyProvider

hasStop

public boolean hasStop(RouteNodeInstance nodeInstance)
Specified by:
hasStop in interface HierarchyProvider

setStop

public void setStop(RouteNodeInstance requestNodeInstance,
                    HierarchyProvider.Stop stop)
Specified by:
setStop in interface HierarchyProvider

equals

public boolean equals(HierarchyProvider.Stop a,
                      HierarchyProvider.Stop b)
Specified by:
equals in interface HierarchyProvider

getParent

public HierarchyProvider.Stop getParent(HierarchyProvider.Stop stop)
Specified by:
getParent in interface HierarchyProvider

isRoot

public boolean isRoot(HierarchyProvider.Stop stop)
Specified by:
isRoot in interface HierarchyProvider

getStop

public HierarchyProvider.Stop getStop(RouteNodeInstance nodeInstance)
Specified by:
getStop in interface HierarchyProvider

configureRequestNode

public void configureRequestNode(RouteNodeInstance hierarchyNodeInstance,
                                 RouteNode node)
Specified by:
configureRequestNode in interface HierarchyProvider


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