org.yawlfoundation.yawl.worklet.rdr
Class RdrTree

java.lang.Object
  extended by org.yawlfoundation.yawl.worklet.rdr.RdrTree

public class RdrTree
extends Object

A Ripple Down Rule tree implementation.

Author:
Michael Adams v0.8, 04-09/2006

Constructor Summary
RdrTree()
          Default constructor
RdrTree(String taskId)
          Constructs an empty tree
 
Method Summary
 RdrNode addNode(RdrNode parentNode, boolean trueBranch)
          Creates a new empty node.
 RdrNode addNode(RdrNode newNode, RdrNode parentNode, boolean trueBranch)
           
 RdrNode createRootNode()
           
 String dump()
          returns a String representation of this tree
 void fromXML(String xml)
           
 List<String> getAllConditions()
          Gets the condition of each node in this tree
 List<String> getAllConditions(RdrNode node)
          Recurses the tree, collecting the condition from each node
protected  YAttributeMap getAttributes()
           
 RdrNode[] getLastPair()
           
 RdrNode getNode(int id)
          Gets the RdrNode for the id passed
 RdrNode getRootNode()
           
 String getTaskId()
           
 org.jdom.Element search(org.jdom.Element caseData)
          evaluates the conditions of each transversed node in this tree
 void setAttributes(String rdrSetName, RuleType rType)
           
 void setRootNode(RdrNode root)
           
 void setTaskId(String id)
           
 String toString()
           
 String toXML()
           
 XNode toXNode()
           
 XNode toXNode(String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RdrTree

public RdrTree()
Default constructor


RdrTree

public RdrTree(String taskId)
Constructs an empty tree

Parameters:
taskId - - id of task that this tree will support
Method Detail

getRootNode

public RdrNode getRootNode()

getTaskId

public String getTaskId()

getLastPair

public RdrNode[] getLastPair()

getNode

public RdrNode getNode(int id)
Gets the RdrNode for the id passed

Parameters:
id - - the node id of the node to find
Returns:
the node identified by the id, or null if this tree has no matching node

getAllConditions

public List<String> getAllConditions()
Gets the condition of each node in this tree

Returns:
a List of all node conditions

getAllConditions

public List<String> getAllConditions(RdrNode node)
Recurses the tree, collecting the condition from each node

Parameters:
node - the root node of this (sub)-tree
Returns:
a List of all node conditions

getAttributes

protected YAttributeMap getAttributes()

setRootNode

public void setRootNode(RdrNode root)

setTaskId

public void setTaskId(String id)

setAttributes

public void setAttributes(String rdrSetName,
                          RuleType rType)

search

public org.jdom.Element search(org.jdom.Element caseData)
evaluates the conditions of each transversed node in this tree

Parameters:
caseData - - a JDOM Element that contains the set of data attributes and values that are used to evaluate the conditional expressions
Returns:
the conclusion of the last node satisfied

createRootNode

public RdrNode createRootNode()

addNode

public RdrNode addNode(RdrNode parentNode,
                       boolean trueBranch)
Creates a new empty node.

Parameters:
parentNode - The proposed parent node for this node
trueBranch - if true, the new node will be placed on the 'true' exception branch; if false, the node will be placed on the 'false' if-not branch

addNode

public RdrNode addNode(RdrNode newNode,
                       RdrNode parentNode,
                       boolean trueBranch)

dump

public String dump()
returns a String representation of this tree


toString

public String toString()
Overrides:
toString in class Object

toXML

public String toXML()

toXNode

public XNode toXNode()

toXNode

public XNode toXNode(String name)

fromXML

public void fromXML(String xml)


Copyright © 2004-2012 The YAWL Foundation.