org.yawlfoundation.yawl.worklet.rdr
Class RdrNode

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

public class RdrNode
extends Object

A Ripple Down Rule Node implementation. Each RdrNode contains an individual rule. The RDRTree class maintains a set of these nodes.

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

Constructor Summary
RdrNode()
          Default constructor
RdrNode(int id)
          Construct a node with all default values.
RdrNode(int id, RdrNode pParent, RdrNode pTrueChild, RdrNode pFalseChild, String pCondition, org.jdom.Element pConclusion, org.jdom.Element pCornerStone)
          Construct a new RdrNode
RdrNode(int id, RdrNode parent, String condition, org.jdom.Element conclusion)
          Construct a node with the basic values provided
RdrNode(String xml)
           
RdrNode(String condition, org.jdom.Element conclusion, org.jdom.Element cornerstone)
          Construct a node with the basic values provided
RdrNode(String condition, RdrConclusion conclusion, org.jdom.Element cornerstone)
          Construct a node with the basic values provided
 
Method Summary
 void fromXML(String xml)
           
protected  void fromXNode(XNode xNode)
          Only called when adding a new node, so it will have no id, parent or children
 org.jdom.Element getConclusion()
           
 String getCondition()
           
 org.jdom.Element getCornerStone()
           
 String getDescription()
           
 RdrNode getFalseChild()
           
 int getNodeId()
           
 String getNodeIdAsString()
           
 RdrNode getParent()
           
 RdrNode getTrueChild()
           
 RdrNode[] recursiveSearch(org.jdom.Element caseData, RdrNode lastTrueNode)
          Recursively search each node using the condition of each to determine the path to take through the tree of which this node is a member.
 void setAttributes(YAttributeMap map, String taskName)
           
 void setConclusion(org.jdom.Element newConclusion)
           
 void setCondition(String newCondition)
           
 void setCornerStone(org.jdom.Element newCorner)
           
 void setDescription(String desc)
           
 void setFalseChild(RdrNode childNode)
           
 void setNodeId(int id)
           
 void setNodeId(String id)
           
 void setParent(RdrNode parentNode)
           
 void setTrueChild(RdrNode childNode)
           
 String toString()
          returns a String representation of this node
 String toXML()
           
 XNode toXNode()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RdrNode

public RdrNode()
Default constructor


RdrNode

public RdrNode(int id,
               RdrNode pParent,
               RdrNode pTrueChild,
               RdrNode pFalseChild,
               String pCondition,
               org.jdom.Element pConclusion,
               org.jdom.Element pCornerStone)
Construct a new RdrNode

Parameters:
id - - the node id of the new node
pParent - - the parent node of this node
pTrueChild - - the node on this node's true branch
pFalseChild - - the node on this node's false branch
pCondition - - the condition stored in this node
pConclusion - - the conclusion stored in this node
pCornerStone - - the cornerstone case data for this node

RdrNode

public RdrNode(int id)
Construct a node with all default values.

Parameters:
id - - the node id for the new node

RdrNode

public RdrNode(String xml)

RdrNode

public RdrNode(int id,
               RdrNode parent,
               String condition,
               org.jdom.Element conclusion)
Construct a node with the basic values provided

Parameters:
id - - the node id of the new node
parent - - the parent node of this node
condition - - the condition stored in this node
conclusion - - the conclusion stored in this node

RdrNode

public RdrNode(String condition,
               org.jdom.Element conclusion,
               org.jdom.Element cornerstone)
Construct a node with the basic values provided

Parameters:
condition - - the condition stored in this node
conclusion - - the conclusion stored in this node
cornerstone - - the data set that led to the creation of this node

RdrNode

public RdrNode(String condition,
               RdrConclusion conclusion,
               org.jdom.Element cornerstone)
Construct a node with the basic values provided

Parameters:
condition - - the condition stored in this node
conclusion - - the conclusion stored in this node
cornerstone - - the data set that led to the creation of this node
Method Detail

getNodeId

public int getNodeId()

getNodeIdAsString

public String getNodeIdAsString()

getCondition

public String getCondition()

getConclusion

public org.jdom.Element getConclusion()

getCornerStone

public org.jdom.Element getCornerStone()

getFalseChild

public RdrNode getFalseChild()

getTrueChild

public RdrNode getTrueChild()

getParent

public RdrNode getParent()

getDescription

public String getDescription()

setNodeId

public void setNodeId(int id)

setNodeId

public void setNodeId(String id)

setCondition

public void setCondition(String newCondition)

setConclusion

public void setConclusion(org.jdom.Element newConclusion)

setCornerStone

public void setCornerStone(org.jdom.Element newCorner)

setFalseChild

public void setFalseChild(RdrNode childNode)

setTrueChild

public void setTrueChild(RdrNode childNode)

setParent

public void setParent(RdrNode parentNode)

setDescription

public void setDescription(String desc)

setAttributes

public void setAttributes(YAttributeMap map,
                          String taskName)

recursiveSearch

public RdrNode[] recursiveSearch(org.jdom.Element caseData,
                                 RdrNode lastTrueNode)
Recursively search each node using the condition of each to determine the path to take through the tree of which this node is a member.

Parameters:
caseData - - a JDOM Element that contains the set of data attributes and values that are used to evaluate the conditional expressions
lastTrueNode - - the RdrNode that contains the last satisfied condition
Returns:
a two node array: [0] the last satisfied node [1] the last node searched

toString

public String toString()
returns a String representation of this node

Overrides:
toString in class Object

toXML

public String toXML()

toXNode

public XNode toXNode()

fromXML

public void fromXML(String xml)

fromXNode

protected void fromXNode(XNode xNode)
Only called when adding a new node, so it will have no id, parent or children

Parameters:
xNode -


Copyright © 2004-2012 The YAWL Foundation.