Package org.drools.core.common
Interface InternalAgenda
-
- All Superinterfaces:
org.kie.api.runtime.rule.Agenda
- All Known Implementing Classes:
CompositeDefaultAgenda,DefaultAgenda,PartitionedDefaultAgenda
public interface InternalAgenda extends org.kie.api.runtime.rule.Agenda
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidactivate()voidactivateRuleFlowGroup(String name)Activates theRuleFlowGroupwith the given name.voidactivateRuleFlowGroup(String name, long processInstanceId, String nodeInstanceId)Activates theRuleFlowGroupwith the given name.voidaddAgendaGroupOnStack(AgendaGroup agendaGroup)voidaddEagerRuleAgendaItem(RuleAgendaItem item)voidaddItemToActivationGroup(AgendaItem item)voidaddPropagation(PropagationEntry propagationEntry)voidaddQueryAgendaItem(RuleAgendaItem item)intagendaSize()Iterates all the modules in the focus stack returning the total number ofActivationsvoidcancelActivation(Activation activation)voidclearAndCancel()Clears all Activations from the AgendavoidclearAndCancelActivationGroup(String name)Clears all Activations from an Activation-Group.voidclearAndCancelActivationGroup(InternalActivationGroup activationGroup)Clears all Activations from an Activation Group.voidclearAndCancelAgendaGroup(String name)Clears all Activations from an Agenda Group.voidclearAndCancelRuleFlowGroup(String name)AgendaItemcreateAgendaItem(RuleTerminalNodeLeftTuple rtnLeftTuple, int salience, PropagationContext context, RuleAgendaItem ruleAgendaItem, InternalAgendaGroup agendaGroup)RuleAgendaItemcreateRuleAgendaItem(int salience, PathMemory rs, TerminalNode rtn)voiddeactivate()voiddeactivateRuleFlowGroup(String name)Deactivates theRuleFlowGroupwith the given name.booleandispose(InternalWorkingMemory wm)voidevaluateEagerList()voidexecuteFlush()voidexecuteTask(ExecutableEntry executable)intfireAllRules(org.kie.api.runtime.rule.AgendaFilter agendaFilter, int fireLimit)Fires all activations currently in agenda that match the given agendaFilter until the fireLimit is reached or no more activations exist.intfireNextItem(org.kie.api.runtime.rule.AgendaFilter filter, int fireCount, int fireLimit)voidfireUntilHalt()Keeps firing activations until a halt is called.voidfireUntilHalt(org.kie.api.runtime.rule.AgendaFilter agendaFilter)Keeps firing activations until a halt is called.voidflushPropagations()intfocusStackSize()Iterates all theAgendGroups in the focus stack returning the total number ofActivationsIterator<PropagationEntry>getActionsIterator()InternalActivationGroupgetActivationGroup(String name)Map<String,InternalActivationGroup>getActivationGroupsMap()Activation[]getActivations()ActivationsFiltergetActivationsFilter()Returns the current activations filter or null if none is setAgendaGroupgetAgendaGroup(String name)AgendaGroupgetAgendaGroup(String name, InternalKnowledgeBase kBase)AgendaGroup[]getAgendaGroups()Map<String,InternalAgendaGroup>getAgendaGroupsMap()StringgetFocusName()Returns the name of the agenda group that currently has the focusCollection<String>getGroupsName()KnowledgeHelpergetKnowledgeHelper()InternalAgendaGroupgetNextFocus()default PropagationListgetPropagationList()RuleFlowGroupgetRuleFlowGroup(String name)InternalWorkingMemorygetWorkingMemory()Returns the WorkignMemory for this Agendavoidhalt()Stop agenda from firing any other rule.voidhandleException(InternalWorkingMemory wm, Activation activation, Exception e)booleanhasPendingPropagations()voidinsertAndStageActivation(AgendaItem activation)booleanisAlive()booleanisDeclarativeAgenda()booleanisFiring()booleanisParallelAgenda()booleanisRuleActiveInRuleFlowGroup(String ruleflowGroupName, String ruleName, long processInstanceId)booleanisRuleInstanceAgendaItem(String ruleflowGroupName, String ruleName, long processInstanceId)Returns true if there is at least one activation of the given rule name in the given ruleflow group namevoidmodifyActivation(AgendaItem activation, boolean previouslyActive)Adds the activation to the agenda.voidnotifyWaitOnRest()RuleAgendaItempeekNextRule()voidputOnAgendaGroupsMap(String name, InternalAgendaGroup group)voidregisterExpiration(PropagationContext expirationContext)voidremoveAgendaGroup(String name)voidremoveEagerRuleAgendaItem(RuleAgendaItem item)voidremoveQueryAgendaItem(RuleAgendaItem item)voidreset()voidsetActivationsFilter(ActivationsFilter filter)Sets a filter that prevents activations from being added to the agenda.voidsetFocus(String name)Sets the Agenda's focus to the specified AgendaGroupbooleansetFocus(AgendaGroup agendaGroup)voidsetWorkingMemory(InternalWorkingMemory workingMemory)intsizeOfRuleFlowGroup(String s)voidstageLeftTuple(RuleAgendaItem ruleAgendaItem, AgendaItem justified)booleantryDeactivate()
-
-
-
Method Detail
-
getWorkingMemory
InternalWorkingMemory getWorkingMemory()
Returns the WorkignMemory for this Agenda- Returns:
- The WorkingMemory
-
setFocus
void setFocus(String name)
Sets the Agenda's focus to the specified AgendaGroup
-
activateRuleFlowGroup
void activateRuleFlowGroup(String name)
Activates theRuleFlowGroupwith the given name. All activations in the givenRuleFlowGroupare added to the agenda. As long as theRuleFlowGroupremains active, its activations are automatically added to the agenda.
-
activateRuleFlowGroup
void activateRuleFlowGroup(String name, long processInstanceId, String nodeInstanceId)
Activates theRuleFlowGroupwith the given name. All activations in the givenRuleFlowGroupare added to the agenda. As long as theRuleFlowGroupremains active, its activations are automatically added to the agenda. The given processInstanceId and nodeInstanceId define the process context in which thisRuleFlowGroupis used.
-
deactivateRuleFlowGroup
void deactivateRuleFlowGroup(String name)
Deactivates theRuleFlowGroupwith the given name. All activations in the givenRuleFlowGroupare removed from the agenda. As long as theRuleFlowGroupremains deactive, its activations are not added to the agenda
-
getAgendaGroups
AgendaGroup[] getAgendaGroups()
-
focusStackSize
int focusStackSize()
Iterates all theAgendGroups in the focus stack returning the total number ofActivations- Returns:
- total number of
Activations on the focus stack
-
agendaSize
int agendaSize()
Iterates all the modules in the focus stack returning the total number ofActivations- Returns:
- total number of activations on the focus stack
-
getActivations
Activation[] getActivations()
-
clearAndCancel
void clearAndCancel()
Clears all Activations from the Agenda
-
clearAndCancelAgendaGroup
void clearAndCancelAgendaGroup(String name)
Clears all Activations from an Agenda Group. Any Activations that are also in an Xor Group are removed the the Xor Group.
-
clearAndCancelActivationGroup
void clearAndCancelActivationGroup(String name)
Clears all Activations from an Activation-Group. Any Activations that are also in an Agenda Group are removed from the Agenda Group.
-
clearAndCancelActivationGroup
void clearAndCancelActivationGroup(InternalActivationGroup activationGroup)
Clears all Activations from an Activation Group. Any Activations that are also in an Agenda Group are removed from the Agenda Group.
-
clearAndCancelRuleFlowGroup
void clearAndCancelRuleFlowGroup(String name)
-
getFocusName
String getFocusName()
Returns the name of the agenda group that currently has the focus
-
fireNextItem
int fireNextItem(org.kie.api.runtime.rule.AgendaFilter filter, int fireCount, int fireLimit)
-
createAgendaItem
AgendaItem createAgendaItem(RuleTerminalNodeLeftTuple rtnLeftTuple, int salience, PropagationContext context, RuleAgendaItem ruleAgendaItem, InternalAgendaGroup agendaGroup)
-
cancelActivation
void cancelActivation(Activation activation)
-
modifyActivation
void modifyActivation(AgendaItem activation, boolean previouslyActive)
Adds the activation to the agenda. Depending on the mode the agenda is running, the activation may be added to the agenda priority queue (synchronously or asynchronously) or be executed immediately.
-
isDeclarativeAgenda
boolean isDeclarativeAgenda()
-
isRuleInstanceAgendaItem
boolean isRuleInstanceAgendaItem(String ruleflowGroupName, String ruleName, long processInstanceId)
Returns true if there is at least one activation of the given rule name in the given ruleflow group name
-
setWorkingMemory
void setWorkingMemory(InternalWorkingMemory workingMemory)
-
fireAllRules
int fireAllRules(org.kie.api.runtime.rule.AgendaFilter agendaFilter, int fireLimit)Fires all activations currently in agenda that match the given agendaFilter until the fireLimit is reached or no more activations exist.- Parameters:
agendaFilter- the filter on which activations may fire.fireLimit- the maximum number of activations that may fire. If -1, then it will fire until no more activations exist.- Returns:
- the number of rules that were actually fired
-
halt
void halt()
Stop agenda from firing any other rule. It will finish the current rule execution though.
-
fireUntilHalt
void fireUntilHalt()
Keeps firing activations until a halt is called. If in a given moment, there is no activation to fire, it will wait for an activation to be added to an active agenda group or rule flow group.
-
fireUntilHalt
void fireUntilHalt(org.kie.api.runtime.rule.AgendaFilter agendaFilter)
Keeps firing activations until a halt is called. If in a given moment, there is no activation to fire, it will wait for an activation to be added to an active agenda group or rule flow group.- Parameters:
agendaFilter- filters the activations that may fire
-
dispose
boolean dispose(InternalWorkingMemory wm)
-
isAlive
boolean isAlive()
-
reset
void reset()
-
getAgendaGroup
AgendaGroup getAgendaGroup(String name)
- Specified by:
getAgendaGroupin interfaceorg.kie.api.runtime.rule.Agenda
-
removeAgendaGroup
void removeAgendaGroup(String name)
-
getAgendaGroup
AgendaGroup getAgendaGroup(String name, InternalKnowledgeBase kBase)
-
getActivationGroup
InternalActivationGroup getActivationGroup(String name)
- Specified by:
getActivationGroupin interfaceorg.kie.api.runtime.rule.Agenda
-
getRuleFlowGroup
RuleFlowGroup getRuleFlowGroup(String name)
- Specified by:
getRuleFlowGroupin interfaceorg.kie.api.runtime.rule.Agenda
-
setActivationsFilter
void setActivationsFilter(ActivationsFilter filter)
Sets a filter that prevents activations from being added to the agenda.
-
getActivationsFilter
ActivationsFilter getActivationsFilter()
Returns the current activations filter or null if none is set
-
createRuleAgendaItem
RuleAgendaItem createRuleAgendaItem(int salience, PathMemory rs, TerminalNode rtn)
-
peekNextRule
RuleAgendaItem peekNextRule()
-
isFiring
boolean isFiring()
-
executeTask
void executeTask(ExecutableEntry executable)
-
executeFlush
void executeFlush()
-
activate
void activate()
-
deactivate
void deactivate()
-
tryDeactivate
boolean tryDeactivate()
-
insertAndStageActivation
void insertAndStageActivation(AgendaItem activation)
-
addEagerRuleAgendaItem
void addEagerRuleAgendaItem(RuleAgendaItem item)
-
removeEagerRuleAgendaItem
void removeEagerRuleAgendaItem(RuleAgendaItem item)
-
addQueryAgendaItem
void addQueryAgendaItem(RuleAgendaItem item)
-
removeQueryAgendaItem
void removeQueryAgendaItem(RuleAgendaItem item)
-
setFocus
boolean setFocus(AgendaGroup agendaGroup)
-
stageLeftTuple
void stageLeftTuple(RuleAgendaItem ruleAgendaItem, AgendaItem justified)
-
getAgendaGroupsMap
Map<String,InternalAgendaGroup> getAgendaGroupsMap()
-
putOnAgendaGroupsMap
void putOnAgendaGroupsMap(String name, InternalAgendaGroup group)
-
addAgendaGroupOnStack
void addAgendaGroupOnStack(AgendaGroup agendaGroup)
-
evaluateEagerList
void evaluateEagerList()
-
getActivationGroupsMap
Map<String,InternalActivationGroup> getActivationGroupsMap()
-
getNextFocus
InternalAgendaGroup getNextFocus()
-
getGroupsName
Collection<String> getGroupsName()
-
sizeOfRuleFlowGroup
int sizeOfRuleFlowGroup(String s)
-
addItemToActivationGroup
void addItemToActivationGroup(AgendaItem item)
-
isRuleActiveInRuleFlowGroup
boolean isRuleActiveInRuleFlowGroup(String ruleflowGroupName, String ruleName, long processInstanceId)
-
registerExpiration
void registerExpiration(PropagationContext expirationContext)
-
addPropagation
void addPropagation(PropagationEntry propagationEntry)
-
flushPropagations
void flushPropagations()
-
notifyWaitOnRest
void notifyWaitOnRest()
-
getActionsIterator
Iterator<PropagationEntry> getActionsIterator()
-
hasPendingPropagations
boolean hasPendingPropagations()
-
handleException
void handleException(InternalWorkingMemory wm, Activation activation, Exception e)
-
isParallelAgenda
boolean isParallelAgenda()
-
getKnowledgeHelper
KnowledgeHelper getKnowledgeHelper()
-
getPropagationList
default PropagationList getPropagationList()
-
-