public class ReteAgenda extends Object implements Externalizable, org.drools.core.common.InternalAgenda
Since many rules may be matched by a single assertObject(...) all scheduled
actions are placed into the Agenda
.
While processing a scheduled action, it may update or retract objects in other scheduled actions, which must then be removed from the agenda. Non-invalidated actions are left on the agenda, and are executed in turn.
Modifier and Type | Class and Description |
---|---|
static class |
ReteAgenda.DummyGarbageCollector |
Modifier and Type | Field and Description |
---|---|
protected int |
activationCounter |
protected AtomicBoolean |
halt |
protected org.drools.core.spi.KnowledgeHelper |
knowledgeHelper |
protected static org.slf4j.Logger |
log |
protected org.drools.core.common.InternalWorkingMemory |
workingMemory
Working memory of this Agenda.
|
Constructor and Description |
---|
ReteAgenda() |
ReteAgenda(org.drools.core.common.InternalRuleBase rb)
Construct.
|
ReteAgenda(org.drools.core.common.InternalRuleBase rb,
boolean initMain)
Construct.
|
Modifier and Type | Method and Description |
---|---|
void |
activateRuleFlowGroup(org.drools.core.common.InternalRuleFlowGroup group,
long processInstanceId,
String nodeInstanceId) |
void |
activateRuleFlowGroup(String name) |
void |
activateRuleFlowGroup(String name,
long processInstanceId,
String nodeInstanceId) |
boolean |
addActivation(org.drools.core.common.AgendaItem activation) |
void |
addActivation(org.drools.core.common.AgendaItem item,
boolean notify) |
void |
addAgendaGroup(org.drools.core.spi.AgendaGroup agendaGroup) |
void |
addAgendaGroupOnStack(org.drools.core.spi.AgendaGroup agendaGroup) |
void |
addAgendaItemToGroup(org.drools.core.common.AgendaItem item) |
void |
addEagerRuleAgendaItem(org.drools.core.phreak.RuleAgendaItem item) |
void |
addItemToActivationGroup(org.drools.core.common.AgendaItem item)
If the item belongs to an activation group, add it
|
int |
agendaSize() |
void |
cancelActivation(org.drools.core.reteoo.LeftTuple leftTuple,
org.drools.core.spi.PropagationContext context,
org.drools.core.common.InternalWorkingMemory workingMemory,
org.drools.core.spi.Activation activation,
org.drools.core.reteoo.TerminalNode rtn) |
void |
clear() |
void |
clearAndCancel() |
void |
clearAndCancelActivationGroup(org.drools.core.spi.ActivationGroup activationGroup) |
void |
clearAndCancelActivationGroup(String name) |
void |
clearAndCancelAgendaGroup(org.drools.core.spi.AgendaGroup agendaGroup) |
void |
clearAndCancelAgendaGroup(String name) |
void |
clearAndCancelAndCancel(org.drools.core.spi.RuleFlowGroup ruleFlowGroup) |
void |
clearAndCancelRuleFlowGroup(String name) |
void |
clearAndCancelStagedActivations() |
boolean |
continueFiring(int fireLimit) |
boolean |
createActivation(org.drools.core.reteoo.LeftTuple tuple,
org.drools.core.spi.PropagationContext context,
org.drools.core.common.InternalWorkingMemory workingMemory,
org.drools.core.reteoo.TerminalNode rtn) |
org.drools.core.common.AgendaItem |
createAgendaItem(org.drools.core.reteoo.LeftTuple tuple,
int salience,
org.drools.core.spi.PropagationContext context,
org.drools.core.reteoo.TerminalNode rtn,
org.drools.core.phreak.RuleAgendaItem ruleAgendaItem,
org.drools.core.common.InternalAgendaGroup agendaGroup) |
boolean |
createPostponedActivation(org.drools.core.reteoo.LeftTuple tuple,
org.drools.core.spi.PropagationContext context,
org.drools.core.common.InternalWorkingMemory workingMemory,
org.drools.core.reteoo.TerminalNode rtn) |
org.drools.core.phreak.RuleAgendaItem |
createRuleAgendaItem(int salience,
org.drools.core.reteoo.PathMemory rs,
org.drools.core.reteoo.TerminalNode rtn) |
org.drools.core.common.ScheduledAgendaItem |
createScheduledAgendaItem(org.drools.core.reteoo.LeftTuple tuple,
org.drools.core.spi.PropagationContext context,
org.drools.core.reteoo.TerminalNode rtn,
org.drools.core.common.InternalAgendaGroup agendaGroup) |
void |
deactivateRuleFlowGroup(org.drools.core.common.InternalRuleFlowGroup group) |
void |
deactivateRuleFlowGroup(String name) |
void |
evaluateEagerList() |
void |
fireActivation(org.drools.core.spi.Activation activation)
Fire this item.
|
int |
fireAllRules(org.drools.core.spi.AgendaFilter agendaFilter,
int fireLimit) |
int |
fireNextItem(org.drools.core.spi.AgendaFilter filter,
int fireCount,
int fireLimit)
Fire the next scheduled
Agenda item, skipping items
that are not allowed by the agenda filter. |
boolean |
fireTimedActivation(org.drools.core.spi.Activation activation,
boolean saveForLater) |
void |
fireUntilHalt() |
void |
fireUntilHalt(org.drools.core.spi.AgendaFilter agendaFilter) |
int |
focusStackSize() |
org.drools.core.spi.ActivationGroup |
getActivationGroup(String name) |
Map<String,org.drools.core.spi.ActivationGroup> |
getActivationGroupsMap() |
org.drools.core.spi.Activation[] |
getActivations() |
org.drools.core.common.ActivationsFilter |
getActivationsFilter() |
org.drools.core.spi.AgendaGroup |
getAgendaGroup(String name) |
org.drools.core.spi.AgendaGroup |
getAgendaGroup(String name,
org.drools.core.common.InternalRuleBase ruleBase) |
org.drools.core.spi.AgendaGroup[] |
getAgendaGroups() |
Map<String,org.drools.core.common.InternalAgendaGroup> |
getAgendaGroupsMap() |
org.drools.core.spi.ConsequenceExceptionHandler |
getConsequenceExceptionHandler() |
org.drools.core.spi.AgendaGroup |
getCurrentAgendaGroup() |
org.drools.core.spi.AgendaGroup |
getFocus() |
String |
getFocusName() |
org.drools.core.common.GarbageCollector |
getGarbageCollector() |
org.drools.core.common.InternalAgendaGroup |
getMainAgendaGroup() |
long |
getNextActivationCounter() |
org.drools.core.common.InternalAgendaGroup |
getNextFocus() |
org.drools.core.spi.RuleFlowGroup |
getRuleFlowGroup(String name) |
org.drools.core.spi.Activation[] |
getScheduledActivations() |
org.drools.core.util.LinkedList<org.drools.core.common.ScheduledAgendaItem> |
getScheduledActivationsLinkedList() |
org.drools.core.spi.AgendaGroup[] |
getStack() |
LinkedList<org.drools.core.spi.AgendaGroup> |
getStackList() |
org.drools.core.spi.ActivationGroup |
getStageActivationsGroup() |
org.drools.core.WorkingMemory |
getWorkingMemory() |
void |
halt() |
void |
insertAndStageActivation(org.drools.core.common.AgendaItem activation) |
boolean |
isDeclarativeAgenda() |
boolean |
isFireUntilHalt() |
boolean |
isRuleInstanceAgendaItem(String ruleflowGroupName,
String ruleName,
long processInstanceId) |
void |
modifyActivation(org.drools.core.common.AgendaItem activation,
boolean previouslyActive) |
void |
notifyHalt() |
org.drools.core.phreak.RuleAgendaItem |
peekNextRule() |
void |
readExternal(ObjectInput in) |
void |
removeActivation(org.drools.core.common.AgendaItem activation) |
void |
removeEagerRuleAgendaItem(org.drools.core.phreak.RuleAgendaItem item) |
void |
removeScheduleItem(org.drools.core.common.ScheduledAgendaItem item) |
void |
scheduleItem(org.drools.core.common.ScheduledAgendaItem item,
org.drools.core.common.InternalWorkingMemory wm)
Schedule an agenda item for delayed firing.
|
void |
setActivationsFilter(org.drools.core.common.ActivationsFilter filter) |
void |
setCurrentAgendaGroup(org.drools.core.common.InternalAgendaGroup agendaGroup) |
boolean |
setFocus(org.drools.core.spi.AgendaGroup agendaGroup) |
void |
setFocus(org.drools.core.spi.PropagationContext ctx,
String name) |
void |
setFocus(String name) |
void |
setWorkingMemory(org.drools.core.common.InternalWorkingMemory workingMemory) |
int |
sizeOfRuleFlowGroup(String name) |
void |
stageLeftTuple(org.drools.core.phreak.RuleAgendaItem ruleAgendaItem,
org.drools.core.common.AgendaItem justified) |
int |
unstageActivations() |
void |
writeExternal(ObjectOutput out) |
protected static transient org.slf4j.Logger log
protected org.drools.core.common.InternalWorkingMemory workingMemory
protected org.drools.core.spi.KnowledgeHelper knowledgeHelper
protected volatile AtomicBoolean halt
protected int activationCounter
public ReteAgenda()
public ReteAgenda(org.drools.core.common.InternalRuleBase rb)
rb
- The InternalRuleBase
of this agenda.public ReteAgenda(org.drools.core.common.InternalRuleBase rb, boolean initMain)
rb
- The InternalRuleBase
of this agenda.initMain
- Flag to initialize the MAIN agenda grouppublic org.drools.core.phreak.RuleAgendaItem createRuleAgendaItem(int salience, org.drools.core.reteoo.PathMemory rs, org.drools.core.reteoo.TerminalNode rtn)
createRuleAgendaItem
in interface org.drools.core.common.InternalAgenda
public long getNextActivationCounter()
getNextActivationCounter
in interface org.drools.core.common.InternalAgenda
public org.drools.core.common.AgendaItem createAgendaItem(org.drools.core.reteoo.LeftTuple tuple, int salience, org.drools.core.spi.PropagationContext context, org.drools.core.reteoo.TerminalNode rtn, org.drools.core.phreak.RuleAgendaItem ruleAgendaItem, org.drools.core.common.InternalAgendaGroup agendaGroup)
createAgendaItem
in interface org.drools.core.common.InternalAgenda
public org.drools.core.common.ScheduledAgendaItem createScheduledAgendaItem(org.drools.core.reteoo.LeftTuple tuple, org.drools.core.spi.PropagationContext context, org.drools.core.reteoo.TerminalNode rtn, org.drools.core.common.InternalAgendaGroup agendaGroup)
createScheduledAgendaItem
in interface org.drools.core.common.InternalAgenda
public void setWorkingMemory(org.drools.core.common.InternalWorkingMemory workingMemory)
setWorkingMemory
in interface org.drools.core.common.InternalAgenda
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public org.drools.core.WorkingMemory getWorkingMemory()
public void addEagerRuleAgendaItem(org.drools.core.phreak.RuleAgendaItem item)
addEagerRuleAgendaItem
in interface org.drools.core.common.InternalAgenda
public void removeEagerRuleAgendaItem(org.drools.core.phreak.RuleAgendaItem item)
removeEagerRuleAgendaItem
in interface org.drools.core.common.InternalAgenda
public void scheduleItem(org.drools.core.common.ScheduledAgendaItem item, org.drools.core.common.InternalWorkingMemory wm)
scheduleItem
in interface org.drools.core.common.InternalAgenda
item
- The item to schedule.public void addItemToActivationGroup(org.drools.core.common.AgendaItem item)
addItemToActivationGroup
in interface org.drools.core.common.InternalAgenda
item
- public org.drools.core.spi.ActivationGroup getStageActivationsGroup()
public void insertAndStageActivation(org.drools.core.common.AgendaItem activation)
insertAndStageActivation
in interface org.drools.core.common.InternalAgenda
public boolean addActivation(org.drools.core.common.AgendaItem activation)
addActivation
in interface org.drools.core.common.InternalAgenda
public boolean isDeclarativeAgenda()
isDeclarativeAgenda
in interface org.drools.core.common.InternalAgenda
public void removeActivation(org.drools.core.common.AgendaItem activation)
removeActivation
in interface org.drools.core.common.InternalAgenda
public void modifyActivation(org.drools.core.common.AgendaItem activation, boolean previouslyActive)
modifyActivation
in interface org.drools.core.common.InternalAgenda
public void clearAndCancelStagedActivations()
public int unstageActivations()
public void addActivation(org.drools.core.common.AgendaItem item, boolean notify)
public void addAgendaItemToGroup(org.drools.core.common.AgendaItem item)
addAgendaItemToGroup
in interface org.drools.core.common.InternalAgenda
public void removeScheduleItem(org.drools.core.common.ScheduledAgendaItem item)
removeScheduleItem
in interface org.drools.core.common.InternalAgenda
public void addAgendaGroup(org.drools.core.spi.AgendaGroup agendaGroup)
addAgendaGroup
in interface org.drools.core.common.InternalAgenda
public boolean createActivation(org.drools.core.reteoo.LeftTuple tuple, org.drools.core.spi.PropagationContext context, org.drools.core.common.InternalWorkingMemory workingMemory, org.drools.core.reteoo.TerminalNode rtn)
createActivation
in interface org.drools.core.common.InternalAgenda
public boolean createPostponedActivation(org.drools.core.reteoo.LeftTuple tuple, org.drools.core.spi.PropagationContext context, org.drools.core.common.InternalWorkingMemory workingMemory, org.drools.core.reteoo.TerminalNode rtn)
createPostponedActivation
in interface org.drools.core.common.InternalAgenda
public void cancelActivation(org.drools.core.reteoo.LeftTuple leftTuple, org.drools.core.spi.PropagationContext context, org.drools.core.common.InternalWorkingMemory workingMemory, org.drools.core.spi.Activation activation, org.drools.core.reteoo.TerminalNode rtn)
cancelActivation
in interface org.drools.core.common.InternalAgenda
public boolean setFocus(org.drools.core.spi.AgendaGroup agendaGroup)
setFocus
in interface org.drools.core.common.InternalAgenda
public void setFocus(String name)
public void setFocus(org.drools.core.spi.PropagationContext ctx, String name)
public org.drools.core.spi.AgendaGroup getFocus()
getFocus
in interface org.drools.core.common.InternalAgenda
public org.drools.core.common.InternalAgendaGroup getNextFocus()
getNextFocus
in interface org.drools.core.common.InternalAgenda
public org.drools.core.phreak.RuleAgendaItem peekNextRule()
peekNextRule
in interface org.drools.core.common.InternalAgenda
public void setCurrentAgendaGroup(org.drools.core.common.InternalAgendaGroup agendaGroup)
public org.drools.core.spi.AgendaGroup getCurrentAgendaGroup()
public org.drools.core.spi.AgendaGroup getAgendaGroup(String name)
getAgendaGroup
in interface org.drools.core.common.InternalAgenda
getAgendaGroup
in interface org.kie.api.runtime.rule.Agenda
public org.drools.core.spi.AgendaGroup getAgendaGroup(String name, org.drools.core.common.InternalRuleBase ruleBase)
getAgendaGroup
in interface org.drools.core.common.InternalAgenda
public org.drools.core.spi.AgendaGroup[] getAgendaGroups()
public Map<String,org.drools.core.common.InternalAgendaGroup> getAgendaGroupsMap()
getAgendaGroupsMap
in interface org.drools.core.common.InternalAgenda
public org.drools.core.common.InternalAgendaGroup getMainAgendaGroup()
public org.drools.core.spi.AgendaGroup[] getStack()
public LinkedList<org.drools.core.spi.AgendaGroup> getStackList()
getStackList
in interface org.drools.core.common.InternalAgenda
public void addAgendaGroupOnStack(org.drools.core.spi.AgendaGroup agendaGroup)
addAgendaGroupOnStack
in interface org.drools.core.common.InternalAgenda
public Map<String,org.drools.core.spi.ActivationGroup> getActivationGroupsMap()
getActivationGroupsMap
in interface org.drools.core.common.InternalAgenda
public org.drools.core.spi.ActivationGroup getActivationGroup(String name)
getActivationGroup
in interface org.drools.core.common.InternalAgenda
getActivationGroup
in interface org.kie.api.runtime.rule.Agenda
public org.drools.core.spi.RuleFlowGroup getRuleFlowGroup(String name)
getRuleFlowGroup
in interface org.drools.core.common.InternalAgenda
getRuleFlowGroup
in interface org.kie.api.runtime.rule.Agenda
public void activateRuleFlowGroup(String name)
public void activateRuleFlowGroup(String name, long processInstanceId, String nodeInstanceId)
public void activateRuleFlowGroup(org.drools.core.common.InternalRuleFlowGroup group, long processInstanceId, String nodeInstanceId)
public void deactivateRuleFlowGroup(String name)
public void deactivateRuleFlowGroup(org.drools.core.common.InternalRuleFlowGroup group)
public int focusStackSize()
public int agendaSize()
public org.drools.core.spi.Activation[] getActivations()
public org.drools.core.spi.Activation[] getScheduledActivations()
public org.drools.core.util.LinkedList<org.drools.core.common.ScheduledAgendaItem> getScheduledActivationsLinkedList()
getScheduledActivationsLinkedList
in interface org.drools.core.common.InternalAgenda
public void clear()
clear
in interface org.drools.core.common.InternalAgenda
clear
in interface org.kie.api.runtime.rule.Agenda
public void clearAndCancel()
public void clearAndCancelAgendaGroup(String name)
public void clearAndCancelAgendaGroup(org.drools.core.spi.AgendaGroup agendaGroup)
public void clearAndCancelActivationGroup(String name)
public void clearAndCancelActivationGroup(org.drools.core.spi.ActivationGroup activationGroup)
public void clearAndCancelRuleFlowGroup(String name)
public void clearAndCancelAndCancel(org.drools.core.spi.RuleFlowGroup ruleFlowGroup)
public int fireNextItem(org.drools.core.spi.AgendaFilter filter, int fireCount, int fireLimit) throws org.drools.core.spi.ConsequenceException
Agenda
item, skipping items
that are not allowed by the agenda filter.fireNextItem
in interface org.drools.core.common.InternalAgenda
org.drools.core.spi.ConsequenceException
- If an error occurs while firing an agenda item.public void evaluateEagerList()
evaluateEagerList
in interface org.drools.core.common.InternalAgenda
public int sizeOfRuleFlowGroup(String name)
sizeOfRuleFlowGroup
in interface org.drools.core.common.InternalAgenda
public void fireActivation(org.drools.core.spi.Activation activation) throws org.drools.core.spi.ConsequenceException
fireActivation
in interface org.drools.core.common.InternalAgenda
activation
- The activation to fireorg.drools.core.spi.ConsequenceException
- If an error occurs while attempting to fire the consequence.public boolean fireTimedActivation(org.drools.core.spi.Activation activation, boolean saveForLater) throws org.drools.core.spi.ConsequenceException
fireTimedActivation
in interface org.drools.core.common.InternalAgenda
org.drools.core.spi.ConsequenceException
public boolean isRuleInstanceAgendaItem(String ruleflowGroupName, String ruleName, long processInstanceId)
isRuleInstanceAgendaItem
in interface org.drools.core.common.InternalAgenda
public String getFocusName()
public boolean isFireUntilHalt()
isFireUntilHalt
in interface org.drools.core.common.InternalAgenda
public void stageLeftTuple(org.drools.core.phreak.RuleAgendaItem ruleAgendaItem, org.drools.core.common.AgendaItem justified)
stageLeftTuple
in interface org.drools.core.common.InternalAgenda
public void fireUntilHalt()
fireUntilHalt
in interface org.drools.core.common.InternalAgenda
public void fireUntilHalt(org.drools.core.spi.AgendaFilter agendaFilter)
fireUntilHalt
in interface org.drools.core.common.InternalAgenda
public int fireAllRules(org.drools.core.spi.AgendaFilter agendaFilter, int fireLimit)
fireAllRules
in interface org.drools.core.common.InternalAgenda
public boolean continueFiring(int fireLimit)
continueFiring
in interface org.drools.core.common.InternalAgenda
public void notifyHalt()
notifyHalt
in interface org.drools.core.common.InternalAgenda
public void halt()
halt
in interface org.drools.core.common.InternalAgenda
public org.drools.core.spi.ConsequenceExceptionHandler getConsequenceExceptionHandler()
public void setActivationsFilter(org.drools.core.common.ActivationsFilter filter)
setActivationsFilter
in interface org.drools.core.common.InternalAgenda
public org.drools.core.common.ActivationsFilter getActivationsFilter()
getActivationsFilter
in interface org.drools.core.common.InternalAgenda
public org.drools.core.common.GarbageCollector getGarbageCollector()
getGarbageCollector
in interface org.drools.core.common.InternalAgenda
Copyright © 2001-2015 JBoss by Red Hat. All Rights Reserved.