public class CompositeDefaultAgenda extends Object implements Externalizable, InternalAgenda
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
log |
Constructor and Description |
---|
CompositeDefaultAgenda() |
CompositeDefaultAgenda(InternalKnowledgeBase kBase) |
CompositeDefaultAgenda(InternalKnowledgeBase kBase,
boolean initMain) |
Modifier and Type | Method and Description |
---|---|
void |
activate() |
void |
activateRuleFlowGroup(String name)
Activates the
RuleFlowGroup with the given name. |
void |
activateRuleFlowGroup(String name,
long processInstanceId,
String nodeInstanceId)
Activates the
RuleFlowGroup with the given name. |
void |
addAgendaGroup(AgendaGroup agendaGroup) |
void |
addAgendaGroupOnStack(AgendaGroup agendaGroup) |
void |
addEagerRuleAgendaItem(RuleAgendaItem item) |
void |
addItemToActivationGroup(AgendaItem item) |
void |
addPropagation(PropagationEntry propagationEntry) |
void |
addQueryAgendaItem(RuleAgendaItem item) |
int |
agendaSize()
Iterates all the modules in the focus stack returning the total number of
Activation s |
void |
cancelActivation(Tuple leftTuple,
PropagationContext context,
Activation activation,
TerminalNode rtn) |
void |
clear() |
void |
clearAndCancel()
Clears all Activations from the Agenda
|
void |
clearAndCancelActivationGroup(InternalActivationGroup activationGroup)
Clears all Activations from an Activation Group.
|
void |
clearAndCancelActivationGroup(String name)
Clears all Activations from an Activation-Group.
|
void |
clearAndCancelAgendaGroup(InternalAgendaGroup agendaGroup)
Clears all Activations from an Agenda Group.
|
void |
clearAndCancelAgendaGroup(String name)
Clears all Activations from an Agenda Group.
|
void |
clearAndCancelRuleFlowGroup(String name) |
AgendaItem |
createAgendaItem(RuleTerminalNodeLeftTuple rtnLeftTuple,
int salience,
PropagationContext context,
RuleAgendaItem ruleAgendaItem,
InternalAgendaGroup agendaGroup) |
RuleAgendaItem |
createRuleAgendaItem(int salience,
PathMemory rs,
TerminalNode rtn) |
void |
deactivate() |
void |
deactivateRuleFlowGroup(String name)
Deactivates the
RuleFlowGroup with the given name. |
boolean |
dispose(InternalWorkingMemory wm) |
void |
evaluateEagerList() |
void |
executeFlush() |
void |
executeTask(ExecutableEntry executable) |
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.
|
int |
fireNextItem(org.kie.api.runtime.rule.AgendaFilter filter,
int fireCount,
int fireLimit) |
void |
fireUntilHalt()
Keeps firing activations until a halt is called.
|
void |
fireUntilHalt(org.kie.api.runtime.rule.AgendaFilter agendaFilter)
Keeps firing activations until a halt is called.
|
void |
flushPropagations() |
int |
focusStackSize()
Iterates all the
AgendGroup |
Iterator<PropagationEntry> |
getActionsIterator() |
InternalActivationGroup |
getActivationGroup(String name) |
Map<String,InternalActivationGroup> |
getActivationGroupsMap() |
Activation[] |
getActivations() |
ActivationsFilter |
getActivationsFilter()
Returns the current activations filter or null if none is set
|
AgendaGroup |
getAgendaGroup(String name) |
AgendaGroup |
getAgendaGroup(String name,
InternalKnowledgeBase kBase) |
AgendaGroup[] |
getAgendaGroups() |
Map<String,InternalAgendaGroup> |
getAgendaGroupsMap() |
AgendaGroup |
getFocus() |
String |
getFocusName()
Returns the name of the agenda group that currently
has the focus
|
KnowledgeHelper |
getKnowledgeHelper() |
InternalAgendaGroup |
getNextFocus() |
DefaultAgenda |
getPartitionedAgenda(int partitionNr) |
DefaultAgenda |
getPartitionedAgendaForNode(NetworkNode node) |
RuleFlowGroup |
getRuleFlowGroup(String name) |
AgendaGroup[] |
getStack() |
LinkedList<AgendaGroup> |
getStackList() |
InternalWorkingMemory |
getWorkingMemory()
Returns the WorkignMemory for this Agenda
|
void |
halt()
Stop agenda from firing any other rule.
|
void |
handleException(InternalWorkingMemory wm,
Activation activation,
Exception e) |
boolean |
hasPendingPropagations() |
void |
insertAndStageActivation(AgendaItem activation) |
boolean |
isAlive() |
boolean |
isDeclarativeAgenda() |
boolean |
isFiring() |
boolean |
isParallelAgenda() |
boolean |
isRuleActiveInRuleFlowGroup(String ruleflowGroupName,
String ruleName,
long processInstanceId) |
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
|
void |
modifyActivation(AgendaItem activation,
boolean previouslyActive)
Adds the activation to the agenda.
|
void |
notifyWaitOnRest() |
RuleAgendaItem |
peekNextRule() |
void |
readExternal(ObjectInput in) |
void |
registerExpiration(PropagationContext expirationContext) |
void |
removeEagerRuleAgendaItem(RuleAgendaItem item) |
void |
removeQueryAgendaItem(RuleAgendaItem item) |
void |
reset() |
void |
setActivationsFilter(ActivationsFilter filter)
Sets a filter that prevents activations from being added to
the agenda.
|
boolean |
setFocus(AgendaGroup agendaGroup) |
void |
setFocus(String name)
Sets the Agenda's focus to the specified AgendaGroup
|
void |
setWorkingMemory(InternalWorkingMemory workingMemory) |
int |
sizeOfRuleFlowGroup(String s) |
void |
stageLeftTuple(RuleAgendaItem ruleAgendaItem,
AgendaItem justified) |
boolean |
tryDeactivate() |
void |
writeExternal(ObjectOutput out) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPropagationList
public CompositeDefaultAgenda()
public CompositeDefaultAgenda(InternalKnowledgeBase kBase)
public CompositeDefaultAgenda(InternalKnowledgeBase kBase, boolean initMain)
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public DefaultAgenda getPartitionedAgenda(int partitionNr)
public DefaultAgenda getPartitionedAgendaForNode(NetworkNode node)
public InternalWorkingMemory getWorkingMemory()
InternalAgenda
getWorkingMemory
in interface InternalAgenda
public void setWorkingMemory(InternalWorkingMemory workingMemory)
setWorkingMemory
in interface InternalAgenda
public int fireAllRules(org.kie.api.runtime.rule.AgendaFilter agendaFilter, int fireLimit)
InternalAgenda
fireAllRules
in interface InternalAgenda
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.public RuleAgendaItem createRuleAgendaItem(int salience, PathMemory rs, TerminalNode rtn)
createRuleAgendaItem
in interface InternalAgenda
public AgendaItem createAgendaItem(RuleTerminalNodeLeftTuple rtnLeftTuple, int salience, PropagationContext context, RuleAgendaItem ruleAgendaItem, InternalAgendaGroup agendaGroup)
createAgendaItem
in interface InternalAgenda
public void fireUntilHalt()
InternalAgenda
fireUntilHalt
in interface InternalAgenda
public void fireUntilHalt(org.kie.api.runtime.rule.AgendaFilter agendaFilter)
InternalAgenda
fireUntilHalt
in interface InternalAgenda
agendaFilter
- filters the activations that may firepublic boolean dispose(InternalWorkingMemory wm)
dispose
in interface InternalAgenda
public boolean isAlive()
isAlive
in interface InternalAgenda
public void halt()
InternalAgenda
halt
in interface InternalAgenda
public boolean isFiring()
isFiring
in interface InternalAgenda
public void addPropagation(PropagationEntry propagationEntry)
addPropagation
in interface InternalAgenda
public void flushPropagations()
flushPropagations
in interface InternalAgenda
public void notifyWaitOnRest()
notifyWaitOnRest
in interface InternalAgenda
public Iterator<PropagationEntry> getActionsIterator()
getActionsIterator
in interface InternalAgenda
public boolean hasPendingPropagations()
hasPendingPropagations
in interface InternalAgenda
public void handleException(InternalWorkingMemory wm, Activation activation, Exception e)
handleException
in interface InternalAgenda
public void clear()
clear
in interface org.kie.api.runtime.rule.Agenda
public void reset()
reset
in interface InternalAgenda
public void executeTask(ExecutableEntry executable)
executeTask
in interface InternalAgenda
public void executeFlush()
executeFlush
in interface InternalAgenda
public void activate()
activate
in interface InternalAgenda
public void deactivate()
deactivate
in interface InternalAgenda
public boolean tryDeactivate()
tryDeactivate
in interface InternalAgenda
public void activateRuleFlowGroup(String name)
InternalAgenda
RuleFlowGroup
with the given name.
All activations in the given RuleFlowGroup
are added to the agenda.
As long as the RuleFlowGroup
remains active,
its activations are automatically added to the agenda.activateRuleFlowGroup
in interface InternalAgenda
public void activateRuleFlowGroup(String name, long processInstanceId, String nodeInstanceId)
InternalAgenda
RuleFlowGroup
with the given name.
All activations in the given RuleFlowGroup
are added to the agenda.
As long as the RuleFlowGroup
remains active,
its activations are automatically added to the agenda.
The given processInstanceId and nodeInstanceId define the process context
in which this RuleFlowGroup
is used.activateRuleFlowGroup
in interface InternalAgenda
public void deactivateRuleFlowGroup(String name)
InternalAgenda
RuleFlowGroup
with the given name.
All activations in the given RuleFlowGroup
are removed from the agenda.
As long as the RuleFlowGroup
remains deactive,
its activations are not added to the agendadeactivateRuleFlowGroup
in interface InternalAgenda
public AgendaGroup[] getAgendaGroups()
getAgendaGroups
in interface InternalAgenda
public AgendaGroup[] getStack()
getStack
in interface InternalAgenda
public int focusStackSize()
InternalAgenda
AgendGroups in the focus stack returning the total number of Activation
s
focusStackSize
in interface InternalAgenda
Activation
s on the focus stackpublic int agendaSize()
InternalAgenda
Activation
sagendaSize
in interface InternalAgenda
public Activation[] getActivations()
getActivations
in interface InternalAgenda
public void clearAndCancel()
InternalAgenda
clearAndCancel
in interface InternalAgenda
public void clearAndCancelAgendaGroup(String name)
InternalAgenda
clearAndCancelAgendaGroup
in interface InternalAgenda
public void clearAndCancelAgendaGroup(InternalAgendaGroup agendaGroup)
InternalAgenda
clearAndCancelAgendaGroup
in interface InternalAgenda
public void clearAndCancelActivationGroup(String name)
InternalAgenda
clearAndCancelActivationGroup
in interface InternalAgenda
public void clearAndCancelActivationGroup(InternalActivationGroup activationGroup)
InternalAgenda
clearAndCancelActivationGroup
in interface InternalAgenda
public void clearAndCancelRuleFlowGroup(String name)
clearAndCancelRuleFlowGroup
in interface InternalAgenda
public String getFocusName()
InternalAgenda
getFocusName
in interface InternalAgenda
public int fireNextItem(org.kie.api.runtime.rule.AgendaFilter filter, int fireCount, int fireLimit) throws ConsequenceException
fireNextItem
in interface InternalAgenda
ConsequenceException
public void cancelActivation(Tuple leftTuple, PropagationContext context, Activation activation, TerminalNode rtn)
cancelActivation
in interface InternalAgenda
public void modifyActivation(AgendaItem activation, boolean previouslyActive)
InternalAgenda
modifyActivation
in interface InternalAgenda
public void addAgendaGroup(AgendaGroup agendaGroup)
addAgendaGroup
in interface InternalAgenda
public boolean isDeclarativeAgenda()
isDeclarativeAgenda
in interface InternalAgenda
public boolean isRuleInstanceAgendaItem(String ruleflowGroupName, String ruleName, long processInstanceId)
InternalAgenda
isRuleInstanceAgendaItem
in interface InternalAgenda
public AgendaGroup getAgendaGroup(String name)
getAgendaGroup
in interface InternalAgenda
getAgendaGroup
in interface org.kie.api.runtime.rule.Agenda
public AgendaGroup getAgendaGroup(String name, InternalKnowledgeBase kBase)
getAgendaGroup
in interface InternalAgenda
public void setFocus(String name)
InternalAgenda
setFocus
in interface InternalAgenda
public boolean setFocus(AgendaGroup agendaGroup)
setFocus
in interface InternalAgenda
public InternalActivationGroup getActivationGroup(String name)
getActivationGroup
in interface InternalAgenda
getActivationGroup
in interface org.kie.api.runtime.rule.Agenda
public RuleFlowGroup getRuleFlowGroup(String name)
getRuleFlowGroup
in interface InternalAgenda
getRuleFlowGroup
in interface org.kie.api.runtime.rule.Agenda
public void setActivationsFilter(ActivationsFilter filter)
InternalAgenda
setActivationsFilter
in interface InternalAgenda
public ActivationsFilter getActivationsFilter()
InternalAgenda
getActivationsFilter
in interface InternalAgenda
public RuleAgendaItem peekNextRule()
peekNextRule
in interface InternalAgenda
public void insertAndStageActivation(AgendaItem activation)
insertAndStageActivation
in interface InternalAgenda
public void addEagerRuleAgendaItem(RuleAgendaItem item)
addEagerRuleAgendaItem
in interface InternalAgenda
public void removeEagerRuleAgendaItem(RuleAgendaItem item)
removeEagerRuleAgendaItem
in interface InternalAgenda
public void addQueryAgendaItem(RuleAgendaItem item)
addQueryAgendaItem
in interface InternalAgenda
public void removeQueryAgendaItem(RuleAgendaItem item)
removeQueryAgendaItem
in interface InternalAgenda
public void stageLeftTuple(RuleAgendaItem ruleAgendaItem, AgendaItem justified)
stageLeftTuple
in interface InternalAgenda
public Map<String,InternalAgendaGroup> getAgendaGroupsMap()
getAgendaGroupsMap
in interface InternalAgenda
public void addAgendaGroupOnStack(AgendaGroup agendaGroup)
addAgendaGroupOnStack
in interface InternalAgenda
public void evaluateEagerList()
evaluateEagerList
in interface InternalAgenda
public Map<String,InternalActivationGroup> getActivationGroupsMap()
getActivationGroupsMap
in interface InternalAgenda
public InternalAgendaGroup getNextFocus()
getNextFocus
in interface InternalAgenda
public LinkedList<AgendaGroup> getStackList()
getStackList
in interface InternalAgenda
public AgendaGroup getFocus()
getFocus
in interface InternalAgenda
public int sizeOfRuleFlowGroup(String s)
sizeOfRuleFlowGroup
in interface InternalAgenda
public void addItemToActivationGroup(AgendaItem item)
addItemToActivationGroup
in interface InternalAgenda
public boolean isRuleActiveInRuleFlowGroup(String ruleflowGroupName, String ruleName, long processInstanceId)
isRuleActiveInRuleFlowGroup
in interface InternalAgenda
public void registerExpiration(PropagationContext expirationContext)
registerExpiration
in interface InternalAgenda
public KnowledgeHelper getKnowledgeHelper()
getKnowledgeHelper
in interface InternalAgenda
public boolean isParallelAgenda()
isParallelAgenda
in interface InternalAgenda
Copyright © 2001–2019 JBoss by Red Hat. All rights reserved.