Package org.drools.core.common
Class AgendaItemImpl
- java.lang.Object
-
- org.drools.core.common.AgendaItemImpl
-
- All Implemented Interfaces:
Serializable,AgendaItem,Activation,org.kie.api.runtime.rule.Match
- Direct Known Subclasses:
RuleAgendaItem
public class AgendaItemImpl extends Object implements AgendaItem
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- Returns:
- The propagation context
-
getRule
public RuleImpl getRule()
Retrieve the rule.- Specified by:
getRulein interfaceActivation- Specified by:
getRulein interfaceorg.kie.api.runtime.rule.Match- Returns:
- The rule.
-
getPartition
public RuleBasePartitionId getPartition()
-
getConsequence
public Consequence getConsequence()
- Specified by:
getConsequencein interfaceActivation
-
getTuple
public Tuple getTuple()
Retrieve the tuple.- Specified by:
getTuplein interfaceActivation- Returns:
- The tuple.
-
getSalience
public int getSalience()
- Specified by:
getSaliencein interfaceActivation
-
setSalience
public void setSalience(int salience)
- Specified by:
setSaliencein interfaceAgendaItem
-
getActivationFactHandle
public InternalFactHandle getActivationFactHandle()
- Specified by:
getActivationFactHandlein interfaceActivation
-
setActivationFactHandle
public void setActivationFactHandle(InternalFactHandle factHandle)
- Specified by:
setActivationFactHandlein interfaceAgendaItem
-
getRuleAgendaItem
public RuleAgendaItem getRuleAgendaItem()
- Specified by:
getRuleAgendaItemin interfaceAgendaItem
-
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- Returns:
- The activation number
-
isQueued
public boolean isQueued()
- Specified by:
isQueuedin interfaceActivation
-
setQueued
public void setQueued(boolean queued)
- Specified by:
setQueuedin interfaceActivation
-
hashCode
public int hashCode()
Return the hashCode of theTupleKeyas the hashCode of the AgendaItem
-
setQueueIndex
public void setQueueIndex(int index)
- Specified by:
setQueueIndexin interfaceActivation
-
dequeue
public void dequeue()
- Specified by:
dequeuein interfaceActivation
-
getQueueIndex
public int getQueueIndex()
- Specified by:
getQueueIndexin interfaceActivation
-
remove
public void remove()
Description copied from interface:ActivationCancel theActivationby removing it from theAgenda.- Specified by:
removein interfaceActivation
-
getActivationGroupNode
public ActivationGroupNode getActivationGroupNode()
- Specified by:
getActivationGroupNodein interfaceActivation
-
setActivationGroupNode
public void setActivationGroupNode(ActivationGroupNode activationNode)
- Specified by:
setActivationGroupNodein interfaceActivation
-
getAgendaGroup
public InternalAgendaGroup getAgendaGroup()
- Specified by:
getAgendaGroupin interfaceActivation
-
getActivationNode
public ActivationNode getActivationNode()
- Specified by:
getActivationNodein interfaceActivation
-
setActivationNode
public void setActivationNode(ActivationNode activationNode)
- Specified by:
setActivationNodein interfaceActivation
-
getSubRule
public GroupElement getSubRule()
Description copied from interface:ActivationRetrieve the subrule that was activated.- Specified by:
getSubRulein interfaceActivation- Returns:
-
getTerminalNode
public TerminalNode getTerminalNode()
- Specified by:
getTerminalNodein interfaceAgendaItem
-
getFactHandles
public List<org.kie.api.runtime.rule.FactHandle> getFactHandles()
- Specified by:
getFactHandlesin interfaceAgendaItem- Specified by:
getFactHandlesin interfaceorg.kie.api.runtime.rule.Match
-
toExternalForm
public String toExternalForm()
- Specified by:
toExternalFormin interfaceAgendaItem
-
getObjects
public List<Object> getObjects()
- Specified by:
getObjectsin interfaceorg.kie.api.runtime.rule.Match
-
getObjectsDeep
public List<Object> getObjectsDeep()
- Specified by:
getObjectsDeepin interfaceActivation
-
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
-
cancel
public void cancel()
- Specified by:
cancelin interfaceAgendaItem
-
isMatched
public boolean isMatched()
- Specified by:
isMatchedin interfaceActivation
-
setMatched
public void setMatched(boolean matched)
- Specified by:
setMatchedin interfaceActivation
-
isActive
public boolean isActive()
- Specified by:
isActivein interfaceActivation
-
setActive
public void setActive(boolean active)
- Specified by:
setActivein interfaceActivation
-
isRuleAgendaItem
public boolean isRuleAgendaItem()
- Specified by:
isRuleAgendaItemin interfaceActivation
-
isRuleInUse
public boolean isRuleInUse()
-
getCallback
public Runnable getCallback()
- Specified by:
getCallbackin interfaceAgendaItem
-
setCallback
public void setCallback(Runnable callback)
- Specified by:
setCallbackin interfaceAgendaItem
-
-