Drools :: Core 6.1.0.Beta1

org.drools.core.common
Interface InternalAgenda

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

public interface InternalAgenda
extends Agenda


Method Summary
 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 cancelActivation(LeftTuple leftTuple, PropagationContext context, InternalWorkingMemory workingMemory, Activation activation, TerminalNode rtn)
           
 void clear()
           
 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 evaluateEagerList()
           
 void fireActivation(Activation activation)
           
 int fireAllRules(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(AgendaFilter filter, int fireCount, int fireLimit)
           
 boolean fireTimedActivation(Activation activation, boolean saveForLater)
           
 void fireUntilHalt()
          Keeps firing activations until a halt is called.
 void fireUntilHalt(AgendaFilter agendaFilter)
          Keeps firing activations until a halt is called.
 ActivationGroup getActivationGroup(String name)
           
 Map<String,ActivationGroup> getActivationGroupsMap()
           
 ActivationsFilter getActivationsFilter()
          Returns the current activations filter or null if none is set
 AgendaGroup getAgendaGroup(String name)
           
 AgendaGroup getAgendaGroup(String name, InternalRuleBase ruleBase)
           
 Map<String,InternalAgendaGroup> getAgendaGroupsMap()
           
 AgendaGroup getFocus()
           
 long getNextActivationCounter()
           
 InternalAgendaGroup getNextFocus()
           
 RuleFlowGroup getRuleFlowGroup(String name)
           
 LinkedList<ScheduledAgendaItem> getScheduledActivationsLinkedList()
           
 LinkedList<AgendaGroup> getStackList()
           
 void halt()
          Stop agenda from firing any other rule.
 void insertAndStageActivation(AgendaItem activation)
           
 boolean isDeclarativeAgenda()
           
 boolean isFireUntilHalt()
           
 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 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 setWorkingMemory(InternalWorkingMemory workingMemory)
           
 int sizeOfRuleFlowGroup(String s)
           
 void stageLeftTuple(RuleAgendaItem ruleAgendaItem, AgendaItem justified)
           
 
Methods inherited from interface org.drools.core.Agenda
activateRuleFlowGroup, activateRuleFlowGroup, agendaSize, clearAndCancel, clearAndCancelActivationGroup, clearAndCancelActivationGroup, clearAndCancelAgendaGroup, clearAndCancelAgendaGroup, clearAndCancelAndCancel, clearAndCancelRuleFlowGroup, deactivateRuleFlowGroup, focusStackSize, getActivations, getAgendaGroups, getFocusName, getScheduledActivations, getStack, getWorkingMemory, setFocus, unstageActivations
 

Method Detail

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

LinkedList<ScheduledAgendaItem> getScheduledActivationsLinkedList()

fireNextItem

int fireNextItem(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:

clear

void clear()
Specified by:
clear in interface org.kie.api.runtime.rule.Agenda

setWorkingMemory

void setWorkingMemory(InternalWorkingMemory workingMemory)

fireAllRules

int fireAllRules(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.
limit -
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(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,
                           InternalRuleBase ruleBase)

getActivationGroup

ActivationGroup 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)

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,ActivationGroup> 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)

Drools :: Core 6.1.0.Beta1

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