Drools :: Core 6.0.0.Beta2

org.drools.core.common
Class AgendaItem

java.lang.Object
  extended by org.drools.core.common.AgendaItem
All Implemented Interfaces:
Externalizable, Serializable, Activation, Queueable, org.kie.api.runtime.rule.Match
Direct Known Subclasses:
RuleNetworkEvaluatorActivation, ScheduledAgendaItem

public class AgendaItem
extends Object
implements Activation, Queueable, Externalizable

Item entry in the Agenda.

See Also:
Serialized Form

Constructor Summary
AgendaItem()
           
AgendaItem(long activationNumber, LeftTuple tuple, int salience, PropagationContext context, TerminalNode rtn, RuleNetworkEvaluatorActivation ruleNetworkEvaluatorActivation)
          Construct.
 
Method Summary
 void addBlocked(LogicalDependency dep)
           
 void addLogicalDependency(LogicalDependency node)
           
 void cancel()
           
 void dequeue()
           
 void enqueued(int index)
           
 boolean equals(Object object)
           
 ActivationGroupNode getActivationGroupNode()
           
 ActivationNode getActivationNode()
           
 long getActivationNumber()
          Each PropgationContext is assigned an id from a counter for the WorkingMemory action it represents.
 org.kie.internal.event.rule.ActivationUnMatchListener getActivationUnMatchListener()
           
 AgendaGroup getAgendaGroup()
           
 LinkedList<LogicalDependency> getBlocked()
           
 LinkedList<LinkedListEntry<LogicalDependency>> getBlockers()
           
 Consequence getConsequence()
           
 List<String> getDeclarationIds()
           
 Object getDeclarationValue(String variableName)
           
 InternalFactHandle getFactHandle()
           
 List<FactHandle> getFactHandles()
           
 int getIndex()
           
 LinkedList<LogicalDependency> getLogicalDependencies()
           
 List<Object> getObjects()
           
 PropagationContext getPropagationContext()
          Retrieve the PropagationContext for the Activation
 Rule getRule()
          Retrieve the rule.
 RuleNetworkEvaluatorActivation getRuleNetworkEvaluatorActivation()
           
 int getSalience()
           
 int getSequenence()
           
 GroupElement getSubRule()
          Retrieve the subrule that was activated.
 TerminalNode getTerminalNode()
           
 LeftTuple getTuple()
          Retrieve the tuple.
 int hashCode()
          Return the hashCode of the TupleKey as the hashCode of the AgendaItem
 boolean isActivated()
           
 boolean isActive()
           
 boolean isCanceled()
           
 boolean isMatched()
           
 boolean isRuleNetworkEvaluatorActivation()
           
 void readExternal(ObjectInput in)
           
 void remove()
          Cancel the Activation by removing it from the Agenda.
 void removeAllBlockersAndBlocked(DefaultAgenda agenda)
           
 void removeBlocked(LogicalDependency dep)
           
 void setActivated(boolean activated)
           
 void setActivationGroupNode(ActivationGroupNode activationNode)
           
 void setActivationNode(ActivationNode activationNode)
           
 void setActivationUnMatchListener(org.kie.internal.event.rule.ActivationUnMatchListener activationUnMatchListener)
           
 void setAgendaGroup(InternalAgendaGroup agendaGroup)
           
 void setBlocked(LinkedList<LogicalDependency> justified)
           
 void setFactHandle(InternalFactHandle factHandle)
           
 void setLogicalDependencies(LinkedList<LogicalDependency> justified)
           
 void setMatched(boolean matched)
           
 void setPropagationContext(PropagationContext context)
           
 void setSalience(int salience)
           
 void setSequenence(int sequenence)
           
 String toExternalForm()
           
 String toString()
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AgendaItem

public AgendaItem()

AgendaItem

public AgendaItem(long activationNumber,
                  LeftTuple tuple,
                  int salience,
                  PropagationContext context,
                  TerminalNode rtn,
                  RuleNetworkEvaluatorActivation ruleNetworkEvaluatorActivation)
Construct.

Parameters:
tuple - The tuple.
ruleNetworkEvaluatorActivation -
Method Detail

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

getPropagationContext

public PropagationContext getPropagationContext()
Description copied from interface: Activation
Retrieve the PropagationContext for the Activation

Specified by:
getPropagationContext in interface Activation
Specified by:
getPropagationContext in interface org.kie.api.runtime.rule.Match
Returns:
The propagation context

setPropagationContext

public void setPropagationContext(PropagationContext context)

getRule

public Rule getRule()
Retrieve the rule.

Specified by:
getRule in interface Activation
Specified by:
getRule in interface org.kie.api.runtime.rule.Match
Returns:
The rule.

getConsequence

public Consequence getConsequence()
Specified by:
getConsequence in interface Activation

getTuple

public LeftTuple getTuple()
Retrieve the tuple.

Specified by:
getTuple in interface Activation
Returns:
The tuple.

getSalience

public int getSalience()
Specified by:
getSalience in interface Activation

setSalience

public void setSalience(int salience)

getSequenence

public int getSequenence()

setSequenence

public void setSequenence(int sequenence)

getFactHandle

public InternalFactHandle getFactHandle()
Specified by:
getFactHandle in interface Activation

setFactHandle

public void setFactHandle(InternalFactHandle factHandle)

getRuleNetworkEvaluatorActivation

public RuleNetworkEvaluatorActivation getRuleNetworkEvaluatorActivation()

getActivationNumber

public long getActivationNumber()
Description copied from interface: Activation
Each PropgationContext is assigned an id from a counter for the WorkingMemory action it represents. All Activations return this id as the ActivationNumber, thus all Activations created from the same PropgationContext will return the same long for this method.

Specified by:
getActivationNumber in interface Activation
Returns:
The activation number

addBlocked

public void addBlocked(LogicalDependency dep)
Specified by:
addBlocked in interface Activation

removeAllBlockersAndBlocked

public void removeAllBlockersAndBlocked(DefaultAgenda agenda)

removeBlocked

public void removeBlocked(LogicalDependency dep)

setBlocked

public void setBlocked(LinkedList<LogicalDependency> justified)
Specified by:
setBlocked in interface Activation

getBlocked

public LinkedList<LogicalDependency> getBlocked()
Specified by:
getBlocked in interface Activation

getBlockers

public LinkedList<LinkedListEntry<LogicalDependency>> getBlockers()
Specified by:
getBlockers in interface Activation

addLogicalDependency

public void addLogicalDependency(LogicalDependency node)
Specified by:
addLogicalDependency in interface Activation

getLogicalDependencies

public LinkedList<LogicalDependency> getLogicalDependencies()
Specified by:
getLogicalDependencies in interface Activation

setLogicalDependencies

public void setLogicalDependencies(LinkedList<LogicalDependency> justified)
Specified by:
setLogicalDependencies in interface Activation

isActivated

public boolean isActivated()
Specified by:
isActivated in interface Activation

setActivated

public void setActivated(boolean activated)
Specified by:
setActivated in interface Activation

toString

public String toString()
Overrides:
toString in class Object

equals

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

hashCode

public int hashCode()
Return the hashCode of the TupleKey as the hashCode of the AgendaItem

Overrides:
hashCode in class Object
Returns:

enqueued

public void enqueued(int index)
Specified by:
enqueued in interface Queueable

dequeue

public void dequeue()
Specified by:
dequeue in interface Queueable

getIndex

public int getIndex()

remove

public void remove()
Description copied from interface: Activation
Cancel the Activation by removing it from the Agenda.

Specified by:
remove in interface Activation

getActivationGroupNode

public ActivationGroupNode getActivationGroupNode()
Specified by:
getActivationGroupNode in interface Activation

setActivationGroupNode

public void setActivationGroupNode(ActivationGroupNode activationNode)
Specified by:
setActivationGroupNode in interface Activation

getAgendaGroup

public AgendaGroup getAgendaGroup()
Specified by:
getAgendaGroup in interface Activation

setAgendaGroup

public void setAgendaGroup(InternalAgendaGroup agendaGroup)

getActivationNode

public ActivationNode getActivationNode()
Specified by:
getActivationNode in interface Activation

setActivationNode

public void setActivationNode(ActivationNode activationNode)
Specified by:
setActivationNode in interface Activation

getSubRule

public GroupElement getSubRule()
Description copied from interface: Activation
Retrieve the subrule that was activated.

Specified by:
getSubRule in interface Activation
Returns:

getTerminalNode

public TerminalNode getTerminalNode()

getActivationUnMatchListener

public org.kie.internal.event.rule.ActivationUnMatchListener getActivationUnMatchListener()

setActivationUnMatchListener

public void setActivationUnMatchListener(org.kie.internal.event.rule.ActivationUnMatchListener activationUnMatchListener)

getFactHandles

public List<FactHandle> getFactHandles()
Specified by:
getFactHandles in interface org.kie.api.runtime.rule.Match

toExternalForm

public String toExternalForm()

getObjects

public List<Object> getObjects()
Specified by:
getObjects in interface org.kie.api.runtime.rule.Match

getDeclarationValue

public Object getDeclarationValue(String variableName)
Specified by:
getDeclarationValue in interface org.kie.api.runtime.rule.Match

getDeclarationIds

public List<String> getDeclarationIds()
Specified by:
getDeclarationIds in interface org.kie.api.runtime.rule.Match

isActive

public boolean isActive()
Specified by:
isActive in interface org.kie.api.runtime.rule.Match

isCanceled

public boolean isCanceled()

cancel

public void cancel()

isMatched

public boolean isMatched()
Specified by:
isMatched in interface Activation

setMatched

public void setMatched(boolean matched)
Specified by:
setMatched in interface Activation

isRuleNetworkEvaluatorActivation

public boolean isRuleNetworkEvaluatorActivation()
Specified by:
isRuleNetworkEvaluatorActivation in interface Activation

Drools :: Core 6.0.0.Beta2

Copyright © 2001-2013 JBoss by Red Hat. All Rights Reserved.