站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss RULES 4.0.0.11754MR2 API 英文版文档

EvalConditionNode (Drools 4.0.0.11754MR2 API) - JBoss RULES 4.0.0.11754MR2 API 英文版文档


org.drools.reteoo
Class EvalConditionNode

java.lang.Object
  extended by org.drools.common.BaseNode
      extended by org.drools.reteoo.TupleSource
          extended by org.drools.reteoo.EvalConditionNode
All Implemented Interfaces:
Serializable, NetworkNode, NodeMemory, TupleSink, TupleSinkNode

public class EvalConditionNode
extends TupleSource
implements TupleSinkNode, NodeMemory

Node which filters ReteTuples.

Using a semantic Test, this node may allow or disallow Tuples to proceed further through the Rete-OO network.

Author:
Mark Proctor, Bob McWhirter
See Also:
EvalConditionNode, Eval, ReteTuple, Serialized Form

Field Summary
 
Fields inherited from class org.drools.reteoo.TupleSource
sink
 
Fields inherited from class org.drools.common.BaseNode
hasMemory, id, sharedCount
 
Constructor Summary
EvalConditionNode(int id, TupleSource tupleSource, EvalCondition eval)
          Construct.
 
Method Summary
 void assertTuple(ReteTuple tuple, PropagationContext context, InternalWorkingMemory workingMemory)
          Assert a new Tuple.
 void attach()
          Attaches this node into the network.
 void attach(InternalWorkingMemory[] workingMemories)
           
 Object createMemory(RuleBaseConfiguration config)
           
 boolean equals(Object object)
           
 EvalCondition getCondition()
          Retrieve the Test associated with this node.
 TupleSinkNode getNextTupleSinkNode()
          Returns the next node
 TupleSinkNode getPreviousTupleSinkNode()
          Returns the previous node
 int hashCode()
          The hashCode return is simply the unique id of the node.
 void remove(BaseNode node, InternalWorkingMemory[] workingMemories)
          Removes the node from teh network.
 void retractTuple(ReteTuple tuple, PropagationContext context, InternalWorkingMemory workingMemory)
           
 void setNextTupleSinkNode(TupleSinkNode next)
          Sets the next node
 void setPreviousTupleSinkNode(TupleSinkNode previous)
          Sets the previous node
 String toString()
          Produce a debug string.
 void updateSink(TupleSink sink, PropagationContext context, InternalWorkingMemory workingMemory)
           
 
Methods inherited from class org.drools.reteoo.TupleSource
addTupleSink, getSinkPropagator, removeTupleSink
 
Methods inherited from class org.drools.common.BaseNode
addShare, getId, getSharedCount, hasMemory, isInUse, isShared, removeShare, setHasMemory
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.drools.common.NodeMemory
getId
 

Constructor Detail

EvalConditionNode

public EvalConditionNode(int id,
                         TupleSource tupleSource,
                         EvalCondition eval)
Construct.

Parameters:
rule - The rule
tupleSource - The source of incoming Tuples.
eval -
Method Detail

attach

public void attach()
Attaches this node into the network.

Specified by:
attach in class BaseNode

attach

public void attach(InternalWorkingMemory[] workingMemories)
Specified by:
attach in class BaseNode

getCondition

public EvalCondition getCondition()
Retrieve the Test associated with this node.

Returns:
The Test.

assertTuple

public void assertTuple(ReteTuple tuple,
                        PropagationContext context,
                        InternalWorkingMemory workingMemory)
Assert a new Tuple.

Specified by:
assertTuple in interface TupleSink
Parameters:
tuple - The Tuple being asserted.
workingMemory - The working memory seesion.
context - The PropagationContext of the WorkingMemory action
Throws:
AssertionException - If an error occurs while asserting.

retractTuple

public void retractTuple(ReteTuple tuple,
                         PropagationContext context,
                         InternalWorkingMemory workingMemory)
Specified by:
retractTuple in interface TupleSink

toString

public String toString()
Produce a debug string.

Overrides:
toString in class BaseNode
Returns:
The debug string.

hashCode

public int hashCode()
Description copied from class: BaseNode
The hashCode return is simply the unique id of the node. It is expected that base classes will also implement equals(Object object).

Overrides:
hashCode in class BaseNode

equals

public boolean equals(Object object)
Overrides:
equals in class Object

createMemory

public Object createMemory(RuleBaseConfiguration config)
Specified by:
createMemory in interface NodeMemory

updateSink

public void updateSink(TupleSink sink,
                       PropagationContext context,
                       InternalWorkingMemory workingMemory)
Specified by:
updateSink in class TupleSource

remove

public void remove(BaseNode node,
                   InternalWorkingMemory[] workingMemories)
Description copied from class: BaseNode
Removes the node from teh network. Usually from the parent ObjectSource or TupleSource

Specified by:
remove in class BaseNode

getNextTupleSinkNode

public TupleSinkNode getNextTupleSinkNode()
Returns the next node

Specified by:
getNextTupleSinkNode in interface TupleSinkNode
Returns:
The next TupleSinkNode

setNextTupleSinkNode

public void setNextTupleSinkNode(TupleSinkNode next)
Sets the next node

Specified by:
setNextTupleSinkNode in interface TupleSinkNode
Parameters:
next - The next TupleSinkNode

getPreviousTupleSinkNode

public TupleSinkNode getPreviousTupleSinkNode()
Returns the previous node

Specified by:
getPreviousTupleSinkNode in interface TupleSinkNode
Returns:
The previous TupleSinkNode

setPreviousTupleSinkNode

public void setPreviousTupleSinkNode(TupleSinkNode previous)
Sets the previous node

Specified by:
setPreviousTupleSinkNode in interface TupleSinkNode
Parameters:
previous - The previous TupleSinkNode


Copyright © 2001-2007 JBoss Inc.. All Rights Reserved.