org.drools.common
Interface InternalAgenda

All Superinterfaces:
org.drools.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 addRuleFlowGroupListener(String ruleFlowGroup, RuleFlowGroupListener listener)
          Adds a RuleFlowGroupListerner to the named RuleFlowGroup
 void clear()
           
 AgendaItem createAgendaItem(LeftTuple tuple, int salience, PropagationContext context, RuleTerminalNode rtn)
           
 ScheduledAgendaItem createScheduledAgendaItem(LeftTuple tuple, PropagationContext context, RuleTerminalNode rtn)
           
 void decreaseActiveActivations()
           
 void decreaseDormantActivations()
           
 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.
 boolean fireNextItem(AgendaFilter filter)
           
 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)
           
 int getActiveActivations()
           
 AgendaGroup getAgendaGroup(String name)
           
 int getDormantActivations()
           
 RuleFlowGroup getRuleFlowGroup(String name)
           
 LinkedList getScheduledActivationsLinkedList()
           
 void halt()
          Stop agenda from firing any other rule.
 void increaseActiveActivations()
           
 void increaseDormantActivations()
           
 boolean isRuleActiveInRuleFlowGroup(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 notifyHalt()
           
 void removeRuleFlowGroupListener(String ruleFlowGroup, RuleFlowGroupListener listener)
          Removes the given RuleFlowGroupListener from the list of listeners of the named RuleFlowGroup
 void removeScheduleItem(ScheduledAgendaItem item)
           
 void scheduleItem(ScheduledAgendaItem item, InternalWorkingMemory workingMemory)
           
 void setWorkingMemory(InternalWorkingMemory workingMemory)
           
 
Methods inherited from interface org.drools.Agenda
activateRuleFlowGroup, activateRuleFlowGroup, agendaSize, clearAndCancel, clearAndCancelActivationGroup, clearAndCancelActivationGroup, clearAndCancelAgendaGroup, clearAndCancelAgendaGroup, clearAndCancelAndCancel, clearAndCancelRuleFlowGroup, deactivateRuleFlowGroup, focusStackSize, getActivations, getAgendaGroups, getFocusName, getScheduledActivations, getStack, getWorkingMemory, setFocus
 

Method Detail

fireActivation

void fireActivation(Activation activation)
                    throws ConsequenceException
Throws:
ConsequenceException

removeScheduleItem

void removeScheduleItem(ScheduledAgendaItem item)

getScheduledActivationsLinkedList

LinkedList getScheduledActivationsLinkedList()

fireNextItem

boolean fireNextItem(AgendaFilter filter)
                     throws ConsequenceException
Throws:
ConsequenceException

scheduleItem

void scheduleItem(ScheduledAgendaItem item,
                  InternalWorkingMemory workingMemory)

createAgendaItem

AgendaItem createAgendaItem(LeftTuple tuple,
                            int salience,
                            PropagationContext context,
                            RuleTerminalNode rtn)

createScheduledAgendaItem

ScheduledAgendaItem createScheduledAgendaItem(LeftTuple tuple,
                                              PropagationContext context,
                                              RuleTerminalNode 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

addAgendaGroup

void addAgendaGroup(AgendaGroup agendaGroup)

increaseActiveActivations

void increaseActiveActivations()

decreaseActiveActivations

void decreaseActiveActivations()

increaseDormantActivations

void increaseDormantActivations()

decreaseDormantActivations

void decreaseDormantActivations()

getActiveActivations

int getActiveActivations()

getDormantActivations

int getDormantActivations()

isRuleActiveInRuleFlowGroup

boolean isRuleActiveInRuleFlowGroup(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:

addRuleFlowGroupListener

void addRuleFlowGroupListener(String ruleFlowGroup,
                              RuleFlowGroupListener listener)
Adds a RuleFlowGroupListerner to the named RuleFlowGroup

Parameters:
ruleFlowGroup -
listener -

removeRuleFlowGroupListener

void removeRuleFlowGroupListener(String ruleFlowGroup,
                                 RuleFlowGroupListener listener)
Removes the given RuleFlowGroupListener from the list of listeners of the named RuleFlowGroup

Parameters:
ruleFlowGroup -
listener -

clear

void clear()
Specified by:
clear in interface org.drools.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.
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.drools.runtime.rule.Agenda

getActivationGroup

ActivationGroup getActivationGroup(String name)
Specified by:
getActivationGroup in interface org.drools.runtime.rule.Agenda

getRuleFlowGroup

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


Copyright © 2001-2013 JBoss Inc.. All Rights Reserved.