Drools :: Core 6.2.0.Final

org.drools.core.common
Interface InternalAgenda

All Superinterfaces:
org.kie.api.runtime.rule.Agenda
All Known Implementing Classes:
DefaultAgenda

public interface InternalAgenda
extends org.kie.api.runtime.rule.Agenda


Method Summary
 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.
 boolean addActivation(AgendaItem activation)
          Adds the activation to the agenda.
 void addAgendaGroup(AgendaGroup agendaGroup)
           
 void addAgendaGroupOnStack(AgendaGroup agendaGroup)
           
 void addAgendaItemToGroup(AgendaItem item)
           
 void addEagerRuleAgendaItem(RuleAgendaItem item)
           
 void addItemToActivationGroup(AgendaItem item)
           
 void addQueryAgendaItem(RuleAgendaItem item)
           
 int agendaSize()
          Iterates all the modules in the focus stack returning the total number of Activations
 void cancelActivation(LeftTuple leftTuple, PropagationContext context, InternalWorkingMemory workingMemory, Activation activation, TerminalNode rtn)
           
 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(AgendaGroup agendaGroup)
          Clears all Activations from an Agenda Group.
 void clearAndCancelAgendaGroup(String name)
          Clears all Activations from an Agenda Group.
 void clearAndCancelAndCancel(RuleFlowGroup ruleFlowGroup)
           
 void clearAndCancelRuleFlowGroup(String name)
           
 boolean continueFiring(int fireLimit)
           
 boolean createActivation(LeftTuple tuple, PropagationContext context, InternalWorkingMemory workingMemory, TerminalNode rtn)
           
 AgendaItem createAgendaItem(LeftTuple tuple, int salience, PropagationContext context, TerminalNode rtn, RuleAgendaItem ruleAgendaItem, InternalAgendaGroup agendaGroup)
           
 boolean createPostponedActivation(LeftTuple postponedTuple, PropagationContext propagationContext, InternalWorkingMemory workingMemory, TerminalNode terminalNode)
           
 RuleAgendaItem createRuleAgendaItem(int salience, PathMemory rs, TerminalNode rtn)
           
 ScheduledAgendaItem createScheduledAgendaItem(LeftTuple tuple, PropagationContext context, TerminalNode rtn, InternalAgendaGroup agendaGroup)
           
 void deactivateRuleFlowGroup(String name)
          Deactivates the RuleFlowGroup with the given name.
 void evaluateEagerList()
           
 void fireActivation(Activation activation)
           
 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)
           
 boolean fireTimedActivation(Activation activation, boolean saveForLater)
           
 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.
 int focusStackSize()
          Iterates all the AgendGroups in the focus stack returning the total number of Activations
 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
 GarbageCollector getGarbageCollector()
           
 long getNextActivationCounter()
           
 InternalAgendaGroup getNextFocus()
           
 RuleFlowGroup getRuleFlowGroup(String name)
           
 Activation[] getScheduledActivations()
           
<T extends ModedAssertion<T>>
LinkedList<ScheduledAgendaItem<T>>
getScheduledActivationsLinkedList()
           
 AgendaGroup[] getStack()
           
 LinkedList<AgendaGroup> getStackList()
           
 WorkingMemory getWorkingMemory()
          Returns the WorkignMemory for this Agenda
 void halt()
          Stop agenda from firing any other rule.
 void insertAndStageActivation(AgendaItem activation)
           
 boolean isDeclarativeAgenda()
           
 boolean isFireUntilHalt()
           
 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)
           
 void notifyHalt()
           
 RuleAgendaItem peekNextRule()
           
 void removeActivation(AgendaItem activation)
           
 void removeEagerRuleAgendaItem(RuleAgendaItem item)
           
 void removeQueryAgendaItem(RuleAgendaItem item)
           
 void removeScheduleItem(ScheduledAgendaItem item)
           
 void scheduleItem(ScheduledAgendaItem item, InternalWorkingMemory workingMemory)
           
 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)
           
 int unstageActivations()
           
 
Methods inherited from interface org.kie.api.runtime.rule.Agenda
clear
 

Method Detail

getWorkingMemory

WorkingMemory 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 the 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

void activateRuleFlowGroup(String name,
                           long processInstanceId,
                           String nodeInstanceId)
Activates the 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.


deactivateRuleFlowGroup

void deactivateRuleFlowGroup(String name)
Deactivates the 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 agenda


getAgendaGroups

AgendaGroup[] getAgendaGroups()

getStack

AgendaGroup[] getStack()

unstageActivations

int unstageActivations()

focusStackSize

int focusStackSize()
Iterates all the AgendGroups in the focus stack returning the total number of Activations

Returns:
total number of Activations on the focus stack

agendaSize

int agendaSize()
Iterates all the modules in the focus stack returning the total number of Activations

Returns:
total number of activations on the focus stack

getActivations

Activation[] getActivations()

getScheduledActivations

Activation[] getScheduledActivations()

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.


clearAndCancelAgendaGroup

void clearAndCancelAgendaGroup(AgendaGroup agendaGroup)
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.

Parameters:
activationGroup -

clearAndCancelRuleFlowGroup

void clearAndCancelRuleFlowGroup(String name)

clearAndCancelAndCancel

void clearAndCancelAndCancel(RuleFlowGroup ruleFlowGroup)

getFocusName

String getFocusName()
Returns the name of the agenda group that currently has the focus

Returns:

fireActivation

void fireActivation(Activation activation)
                    throws ConsequenceException
Throws:
ConsequenceException

fireTimedActivation

boolean fireTimedActivation(Activation activation,
                            boolean saveForLater)
                            throws ConsequenceException
Throws:
ConsequenceException

removeScheduleItem

void removeScheduleItem(ScheduledAgendaItem item)

getScheduledActivationsLinkedList

<T extends ModedAssertion<T>> LinkedList<ScheduledAgendaItem<T>> getScheduledActivationsLinkedList()

fireNextItem

int fireNextItem(org.kie.api.runtime.rule.AgendaFilter filter,
                 int fireCount,
                 int fireLimit)
                 throws ConsequenceException
Throws:
ConsequenceException

scheduleItem

void scheduleItem(ScheduledAgendaItem item,
                  InternalWorkingMemory workingMemory)

createAgendaItem

AgendaItem createAgendaItem(LeftTuple tuple,
                            int salience,
                            PropagationContext context,
                            TerminalNode rtn,
                            RuleAgendaItem ruleAgendaItem,
                            InternalAgendaGroup agendaGroup)

createScheduledAgendaItem

ScheduledAgendaItem createScheduledAgendaItem(LeftTuple tuple,
                                              PropagationContext context,
                                              TerminalNode rtn,
                                              InternalAgendaGroup agendaGroup)

createActivation

boolean createActivation(LeftTuple tuple,
                         PropagationContext context,
                         InternalWorkingMemory workingMemory,
                         TerminalNode rtn)

cancelActivation

void cancelActivation(LeftTuple leftTuple,
                      PropagationContext context,
                      InternalWorkingMemory workingMemory,
                      Activation activation,
                      TerminalNode rtn)

addActivation

boolean addActivation(AgendaItem activation)
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.

Parameters:
activation -
Returns:
true if the activation was really added, and not ignored in cases of lock-on-active or no-loop

removeActivation

void removeActivation(AgendaItem activation)

modifyActivation

void modifyActivation(AgendaItem activation,
                      boolean previouslyActive)

addAgendaGroup

void addAgendaGroup(AgendaGroup agendaGroup)

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

Parameters:
ruleflowGroupName -
ruleName -
Returns:

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.
fireLimit -
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.


notifyHalt

void notifyHalt()

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

getAgendaGroup

AgendaGroup getAgendaGroup(String name)
Specified by:
getAgendaGroup in interface org.kie.api.runtime.rule.Agenda

getAgendaGroup

AgendaGroup getAgendaGroup(String name,
                           InternalKnowledgeBase kBase)

getActivationGroup

InternalActivationGroup getActivationGroup(String name)
Specified by:
getActivationGroup in interface org.kie.api.runtime.rule.Agenda

getRuleFlowGroup

RuleFlowGroup getRuleFlowGroup(String name)
Specified by:
getRuleFlowGroup in interface org.kie.api.runtime.rule.Agenda

setActivationsFilter

void setActivationsFilter(ActivationsFilter filter)
Sets a filter that prevents activations from being added to the agenda.

Parameters:
filter -

getActivationsFilter

ActivationsFilter getActivationsFilter()
Returns the current activations filter or null if none is set

Returns:

createRuleAgendaItem

RuleAgendaItem createRuleAgendaItem(int salience,
                                    PathMemory rs,
                                    TerminalNode rtn)

peekNextRule

RuleAgendaItem peekNextRule()

continueFiring

boolean continueFiring(int fireLimit)

insertAndStageActivation

void insertAndStageActivation(AgendaItem activation)

addAgendaItemToGroup

void addAgendaItemToGroup(AgendaItem item)

addEagerRuleAgendaItem

void addEagerRuleAgendaItem(RuleAgendaItem item)

removeEagerRuleAgendaItem

void removeEagerRuleAgendaItem(RuleAgendaItem item)

addQueryAgendaItem

void addQueryAgendaItem(RuleAgendaItem item)

removeQueryAgendaItem

void removeQueryAgendaItem(RuleAgendaItem item)

getNextActivationCounter

long getNextActivationCounter()

setFocus

boolean setFocus(AgendaGroup agendaGroup)

isFireUntilHalt

boolean isFireUntilHalt()

stageLeftTuple

void stageLeftTuple(RuleAgendaItem ruleAgendaItem,
                    AgendaItem justified)

getAgendaGroupsMap

Map<String,InternalAgendaGroup> getAgendaGroupsMap()

addAgendaGroupOnStack

void addAgendaGroupOnStack(AgendaGroup agendaGroup)

evaluateEagerList

void evaluateEagerList()

getActivationGroupsMap

Map<String,InternalActivationGroup> getActivationGroupsMap()

getNextFocus

InternalAgendaGroup getNextFocus()

getStackList

LinkedList<AgendaGroup> getStackList()

getFocus

AgendaGroup getFocus()

sizeOfRuleFlowGroup

int sizeOfRuleFlowGroup(String s)

addItemToActivationGroup

void addItemToActivationGroup(AgendaItem item)

createPostponedActivation

boolean createPostponedActivation(LeftTuple postponedTuple,
                                  PropagationContext propagationContext,
                                  InternalWorkingMemory workingMemory,
                                  TerminalNode terminalNode)

isRuleActiveInRuleFlowGroup

boolean isRuleActiveInRuleFlowGroup(String ruleflowGroupName,
                                    String ruleName,
                                    long processInstanceId)

getGarbageCollector

GarbageCollector getGarbageCollector()

Drools :: Core 6.2.0.Final

Copyright © 2001-2015 JBoss by Red Hat. All Rights Reserved.