Package org.drools.core.common
Class AgendaItemImpl<T extends ModedAssertion<T>>
- java.lang.Object
-
- org.drools.core.common.AgendaItemImpl<T>
-
- All Implemented Interfaces:
Serializable,AgendaItem<T>,Activation<T>,org.kie.api.runtime.rule.Match
- Direct Known Subclasses:
RuleAgendaItem
public class AgendaItemImpl<T extends ModedAssertion<T>> extends Object implements AgendaItem<T>
Item entry in theAgenda.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AgendaItemImpl()AgendaItemImpl(long activationNumber, Tuple tuple, int salience, PropagationContext context, TerminalNode rtn, InternalAgendaGroup agendaGroup)Construct.
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.drools.core.common.AgendaItem
getFactHandles, getObjects, getObjectsDeep
-
-
-
-
Constructor Detail
-
AgendaItemImpl
public AgendaItemImpl()
-
AgendaItemImpl
public AgendaItemImpl(long activationNumber, Tuple tuple, int salience, PropagationContext context, TerminalNode rtn, InternalAgendaGroup agendaGroup)Construct.- Parameters:
tuple- The tuple.agendaGroup-
-
-
Method Detail
-
getPropagationContext
public PropagationContext getPropagationContext()
Description copied from interface:ActivationRetrieve thePropagationContextfor theActivation- Specified by:
getPropagationContextin interfaceActivation<T extends ModedAssertion<T>>- Returns:
- The propagation context
-
setPropagationContext
public void setPropagationContext(PropagationContext context)
- Specified by:
setPropagationContextin interfaceAgendaItem<T extends ModedAssertion<T>>
-
getRule
public RuleImpl getRule()
Retrieve the rule.- Specified by:
getRulein interfaceActivation<T extends ModedAssertion<T>>- Specified by:
getRulein interfaceorg.kie.api.runtime.rule.Match- Returns:
- The rule.
-
getPartition
public RuleBasePartitionId getPartition()
-
getConsequence
public Consequence getConsequence()
- Specified by:
getConsequencein interfaceActivation<T extends ModedAssertion<T>>
-
getTuple
public Tuple getTuple()
Retrieve the tuple.- Specified by:
getTuplein interfaceActivation<T extends ModedAssertion<T>>- Returns:
- The tuple.
-
getSalience
public int getSalience()
- Specified by:
getSaliencein interfaceActivation<T extends ModedAssertion<T>>
-
setSalience
public void setSalience(int salience)
- Specified by:
setSaliencein interfaceAgendaItem<T extends ModedAssertion<T>>
-
getActivationFactHandle
public InternalFactHandle getActivationFactHandle()
- Specified by:
getActivationFactHandlein interfaceActivation<T extends ModedAssertion<T>>
-
setActivationFactHandle
public void setActivationFactHandle(InternalFactHandle factHandle)
- Specified by:
setActivationFactHandlein interfaceAgendaItem<T extends ModedAssertion<T>>
-
getRuleAgendaItem
public RuleAgendaItem getRuleAgendaItem()
- Specified by:
getRuleAgendaItemin interfaceAgendaItem<T extends ModedAssertion<T>>
-
getActivationNumber
public long getActivationNumber()
Description copied from interface:ActivationEach 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:
getActivationNumberin interfaceActivation<T extends ModedAssertion<T>>- Returns:
- The activation number
-
addBlocked
public void addBlocked(LogicalDependency<SimpleMode> dep)
- Specified by:
addBlockedin interfaceActivation<T extends ModedAssertion<T>>
-
removeAllBlockersAndBlocked
public void removeAllBlockersAndBlocked(ActivationsManager activationsManager)
- Specified by:
removeAllBlockersAndBlockedin interfaceAgendaItem<T extends ModedAssertion<T>>
-
removeBlocked
public void removeBlocked(LogicalDependency<SimpleMode> dep)
- Specified by:
removeBlockedin interfaceAgendaItem<T extends ModedAssertion<T>>
-
getBlocked
public LinkedList<LogicalDependency<SimpleMode>> getBlocked()
- Specified by:
getBlockedin interfaceActivation<T extends ModedAssertion<T>>
-
setBlocked
public void setBlocked(LinkedList<LogicalDependency<SimpleMode>> justified)
- Specified by:
setBlockedin interfaceActivation<T extends ModedAssertion<T>>
-
getBlockers
public LinkedList<SimpleMode> getBlockers()
- Specified by:
getBlockersin interfaceActivation<T extends ModedAssertion<T>>
-
addLogicalDependency
public void addLogicalDependency(LogicalDependency<T> node)
- Specified by:
addLogicalDependencyin interfaceActivation<T extends ModedAssertion<T>>
-
getLogicalDependencies
public LinkedList<LogicalDependency<T>> getLogicalDependencies()
- Specified by:
getLogicalDependenciesin interfaceActivation<T extends ModedAssertion<T>>
-
setLogicalDependencies
public void setLogicalDependencies(LinkedList<LogicalDependency<T>> justified)
- Specified by:
setLogicalDependenciesin interfaceActivation<T extends ModedAssertion<T>>
-
isQueued
public boolean isQueued()
- Specified by:
isQueuedin interfaceActivation<T extends ModedAssertion<T>>
-
setQueued
public void setQueued(boolean queued)
- Specified by:
setQueuedin interfaceActivation<T extends ModedAssertion<T>>
-
hashCode
public int hashCode()
Return the hashCode of theTupleKeyas the hashCode of the AgendaItem
-
setQueueIndex
public void setQueueIndex(int index)
- Specified by:
setQueueIndexin interfaceActivation<T extends ModedAssertion<T>>
-
dequeue
public void dequeue()
- Specified by:
dequeuein interfaceActivation<T extends ModedAssertion<T>>
-
getQueueIndex
public int getQueueIndex()
- Specified by:
getQueueIndexin interfaceActivation<T extends ModedAssertion<T>>
-
remove
public void remove()
Description copied from interface:ActivationCancel theActivationby removing it from theAgenda.- Specified by:
removein interfaceActivation<T extends ModedAssertion<T>>
-
getActivationGroupNode
public ActivationGroupNode getActivationGroupNode()
- Specified by:
getActivationGroupNodein interfaceActivation<T extends ModedAssertion<T>>
-
setActivationGroupNode
public void setActivationGroupNode(ActivationGroupNode activationNode)
- Specified by:
setActivationGroupNodein interfaceActivation<T extends ModedAssertion<T>>
-
getAgendaGroup
public InternalAgendaGroup getAgendaGroup()
- Specified by:
getAgendaGroupin interfaceActivation<T extends ModedAssertion<T>>
-
getActivationNode
public ActivationNode getActivationNode()
- Specified by:
getActivationNodein interfaceActivation<T extends ModedAssertion<T>>
-
setActivationNode
public void setActivationNode(ActivationNode activationNode)
- Specified by:
setActivationNodein interfaceActivation<T extends ModedAssertion<T>>
-
getSubRule
public GroupElement getSubRule()
Description copied from interface:ActivationRetrieve the subrule that was activated.- Specified by:
getSubRulein interfaceActivation<T extends ModedAssertion<T>>- Returns:
-
getTerminalNode
public TerminalNode getTerminalNode()
- Specified by:
getTerminalNodein interfaceAgendaItem<T extends ModedAssertion<T>>
-
getFactHandles
public List<org.kie.api.runtime.rule.FactHandle> getFactHandles()
- Specified by:
getFactHandlesin interfaceAgendaItem<T extends ModedAssertion<T>>- Specified by:
getFactHandlesin interfaceorg.kie.api.runtime.rule.Match
-
toExternalForm
public String toExternalForm()
- Specified by:
toExternalFormin interfaceAgendaItem<T extends ModedAssertion<T>>
-
getObjects
public List<Object> getObjects()
- Specified by:
getObjectsin interfaceorg.kie.api.runtime.rule.Match
-
getObjectsDeep
public List<Object> getObjectsDeep()
- Specified by:
getObjectsDeepin interfaceActivation<T extends ModedAssertion<T>>
-
getDeclarationValue
public Object getDeclarationValue(String variableName)
- Specified by:
getDeclarationValuein interfaceorg.kie.api.runtime.rule.Match
-
getDeclarationIds
public List<String> getDeclarationIds()
- Specified by:
getDeclarationIdsin interfaceorg.kie.api.runtime.rule.Match
-
isCanceled
public boolean isCanceled()
- Specified by:
isCanceledin interfaceAgendaItem<T extends ModedAssertion<T>>
-
cancel
public void cancel()
- Specified by:
cancelin interfaceAgendaItem<T extends ModedAssertion<T>>
-
isMatched
public boolean isMatched()
- Specified by:
isMatchedin interfaceActivation<T extends ModedAssertion<T>>
-
setMatched
public void setMatched(boolean matched)
- Specified by:
setMatchedin interfaceActivation<T extends ModedAssertion<T>>
-
isActive
public boolean isActive()
- Specified by:
isActivein interfaceActivation<T extends ModedAssertion<T>>
-
setActive
public void setActive(boolean active)
- Specified by:
setActivein interfaceActivation<T extends ModedAssertion<T>>
-
isRuleAgendaItem
public boolean isRuleAgendaItem()
- Specified by:
isRuleAgendaItemin interfaceActivation<T extends ModedAssertion<T>>
-
isRuleInUse
public boolean isRuleInUse()
-
getCallback
public Runnable getCallback()
- Specified by:
getCallbackin interfaceAgendaItem<T extends ModedAssertion<T>>
-
setCallback
public void setCallback(Runnable callback)
- Specified by:
setCallbackin interfaceAgendaItem<T extends ModedAssertion<T>>
-
-