org.kuali.rice.kew.engine.node
Class RouteNodeUtils

java.lang.Object
  extended by org.kuali.rice.kew.engine.node.RouteNodeUtils

public class RouteNodeUtils
extends Object

A simple class for performing operations on RouteNode. In particular, this class provides some convenience methods for processing custom RouteNode XML content fragments.

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

Nested Class Summary
private static class RouteNodeUtils.RouteNodeSorter
          Sorts by RouteNodeId or the order the nodes will be evaluated in *roughly*.
 
Constructor Summary
RouteNodeUtils()
           
 
Method Summary
static RouteNodeInstance findRouteNodeInstanceById(Long nodeInstanceId, DocumentRouteHeaderValue document)
           
private static void flattenNodeGraph(Map<String,RouteNode> nodes, RouteNode node)
          Recursively walks the node graph and builds up the map.
private static void flattenNodeInstanceGraph(List<RouteNodeInstance> nodeInstances, Set<Long> visitedNodeInstanceIds, RouteNodeInstance nodeInstance, boolean includeProcesses)
           
static List<RouteNodeInstance> getActiveNodeInstances(DocumentRouteHeaderValue document)
           
static List<RouteNodeInstance> getFlattenedNodeInstances(DocumentRouteHeaderValue document, boolean includeProcesses)
           
static List<RouteNode> getFlattenedNodes(DocumentType documentType, boolean climbHierarchy)
           
static List<RouteNode> getFlattenedNodes(Process process)
           
static String getValueOfCustomProperty(RouteNode routeNode, String propertyName)
          Searches a RouteNode's "contentFragment" (it's XML definition) for an XML element with the given name and returns it's value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RouteNodeUtils

public RouteNodeUtils()
Method Detail

getValueOfCustomProperty

public static String getValueOfCustomProperty(RouteNode routeNode,
                                              String propertyName)
Searches a RouteNode's "contentFragment" (it's XML definition) for an XML element with the given name and returns it's value.

For example, in a node with the following definition:


   ...
   propertyValue
 

An invocation of getValueOfCustomProperty(routeNode, "myCustomProperty") would return "propertyValue".

Parameters:
routeNode - RouteNode to examine
propertyName - name of the XML element to search for
Returns:
the value of the XML element, or null if it could not be located

getFlattenedNodeInstances

public static List<RouteNodeInstance> getFlattenedNodeInstances(DocumentRouteHeaderValue document,
                                                                boolean includeProcesses)

flattenNodeInstanceGraph

private static void flattenNodeInstanceGraph(List<RouteNodeInstance> nodeInstances,
                                             Set<Long> visitedNodeInstanceIds,
                                             RouteNodeInstance nodeInstance,
                                             boolean includeProcesses)

getFlattenedNodes

public static List<RouteNode> getFlattenedNodes(DocumentType documentType,
                                                boolean climbHierarchy)

getFlattenedNodes

public static List<RouteNode> getFlattenedNodes(Process process)

flattenNodeGraph

private static void flattenNodeGraph(Map<String,RouteNode> nodes,
                                     RouteNode node)
Recursively walks the node graph and builds up the map. Uses a map because we will end up walking through duplicates, as is the case with Join nodes.

Parameters:
nodes - map
node - graph

getActiveNodeInstances

public static List<RouteNodeInstance> getActiveNodeInstances(DocumentRouteHeaderValue document)

findRouteNodeInstanceById

public static RouteNodeInstance findRouteNodeInstanceById(Long nodeInstanceId,
                                                          DocumentRouteHeaderValue document)


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