站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss RULES 4.0.0.11754MR2 API 英文版文档

DefaultAgenda (Drools 4.0.0.11754MR2 API) - JBoss RULES 4.0.0.11754MR2 API 英文版文档


org.drools.common
Class DefaultAgenda

java.lang.Object
  extended by org.drools.common.DefaultAgenda
All Implemented Interfaces:
Serializable, Agenda, InternalAgenda

public class DefaultAgenda
extends Object
implements Serializable, InternalAgenda

Rule-firing Agenda.

Since many rules may be matched by a single assertObject(...) all scheduled actions are placed into the Agenda.

While processing a scheduled action, it may modify or retract objects in other scheduled actions, which must then be removed from the agenda. Non-invalidated actions are left on the agenda, and are executed in turn.

Author:
bob mcwhirter , Simon Harris
See Also:
Serialized Form

Field Summary
 int activeActivations
           
 int dormantActivations
           
 
Constructor Summary
DefaultAgenda(InternalWorkingMemory workingMemory)
          Construct.
 
Method Summary
 void activateRuleFlowGroup(String name)
          Activates the RuleFlowGroup with the given name.
 void addAgendaGroup(AgendaGroup agendaGroup)
           
 int agendaSize()
          Iterates all the modules in the focus stack returning the total number of Activations
 void clearActivationGroup(ActivationGroup activationGroup)
          Clears all Activations from an Xor Group.
 void clearActivationGroup(String name)
          Clears all Activations from an Activation-Group.
 void clearAgenda()
          Clears all Activations from the Agenda
 void clearAgendaGroup(AgendaGroup agendaGroup)
          Clears all Activations from an Agenda Group.
 void clearAgendaGroup(String name)
          Clears all Activations from an Agenda Group.
 void deactivateRuleFlowGroup(String name)
          Deactivates the RuleFlowGroup with the given name.
 void decreaseActiveActivations()
           
 void decreaseDormantActivations()
           
 void fireActivation(Activation activation)
          Fire this item.
 boolean fireNextItem(AgendaFilter filter)
          Fire the next scheduled Agenda item.
 int focusStackSize()
          Iterates all the AgendGroups in the focus stack returning the total number of Activations
 ActivationGroup getActivationGroup(String name)
           
 Activation[] getActivations()
           
 int getActiveActivations()
           
 AgendaGroup getAgendaGroup(String name)
           
 AgendaGroup[] getAgendaGroups()
           
 AgendaGroup getCurrentAgendaGroup()
           
 int getDormantActivations()
           
 AgendaGroup getFocus()
           
 AgendaGroup getNextFocus()
           
 RuleFlowGroup getRuleFlowGroup(String name)
           
 Activation[] getScheduledActivations()
           
 LinkedList getScheduledItems()
           
 AgendaGroup[] getStack()
           
 WorkingMemory getWorkingMemory()
           
 void increaseActiveActivations()
           
 void increaseDormantActivations()
           
 void removeScheduleItem(ScheduledAgendaItem item)
           
 void scheduleItem(ScheduledAgendaItem item)
          Schedule an agenda item for delayed firing.
 void setCurrentAgendaGroup(AgendaGroup agendaGroup)
           
 boolean setFocus(AgendaGroup agendaGroup)
           
 void setFocus(String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

activeActivations

public int activeActivations

dormantActivations

public int dormantActivations
Constructor Detail

DefaultAgenda

public DefaultAgenda(InternalWorkingMemory workingMemory)
Construct.

Parameters:
workingMemory - The WorkingMemory of this agenda.
conflictResolver - The conflict resolver.
Method Detail

getWorkingMemory

public WorkingMemory getWorkingMemory()
Specified by:
getWorkingMemory in interface Agenda

scheduleItem

public void scheduleItem(ScheduledAgendaItem item)
Schedule an agenda item for delayed firing.

Specified by:
scheduleItem in interface InternalAgenda
Parameters:
item - The item to schedule.

removeScheduleItem

public void removeScheduleItem(ScheduledAgendaItem item)
Specified by:
removeScheduleItem in interface InternalAgenda

getScheduledItems

public LinkedList getScheduledItems()
Specified by:
getScheduledItems in interface Agenda

addAgendaGroup

public void addAgendaGroup(AgendaGroup agendaGroup)
Specified by:
addAgendaGroup in interface InternalAgenda

setFocus

public boolean setFocus(AgendaGroup agendaGroup)
Specified by:
setFocus in interface Agenda

setFocus

public void setFocus(String name)
Specified by:
setFocus in interface Agenda

getFocus

public AgendaGroup getFocus()
Specified by:
getFocus in interface Agenda

getNextFocus

public AgendaGroup getNextFocus()

setCurrentAgendaGroup

public void setCurrentAgendaGroup(AgendaGroup agendaGroup)

getCurrentAgendaGroup

public AgendaGroup getCurrentAgendaGroup()

getAgendaGroup

public AgendaGroup getAgendaGroup(String name)
Specified by:
getAgendaGroup in interface Agenda

getAgendaGroups

public AgendaGroup[] getAgendaGroups()
Specified by:
getAgendaGroups in interface Agenda

getStack

public AgendaGroup[] getStack()
Specified by:
getStack in interface Agenda

getActivationGroup

public ActivationGroup getActivationGroup(String name)
Specified by:
getActivationGroup in interface Agenda

getRuleFlowGroup

public RuleFlowGroup getRuleFlowGroup(String name)
Specified by:
getRuleFlowGroup in interface Agenda

activateRuleFlowGroup

public void activateRuleFlowGroup(String name)
Description copied from interface: Agenda
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.

Specified by:
activateRuleFlowGroup in interface Agenda

deactivateRuleFlowGroup

public void deactivateRuleFlowGroup(String name)
Description copied from interface: Agenda
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

Specified by:
deactivateRuleFlowGroup in interface Agenda

focusStackSize

public int focusStackSize()
Description copied from interface: Agenda
Iterates all the AgendGroups in the focus stack returning the total number of Activations

Specified by:
focusStackSize in interface Agenda
Returns:
total number of Activations on the focus stack

agendaSize

public int agendaSize()
Description copied from interface: Agenda
Iterates all the modules in the focus stack returning the total number of Activations

Specified by:
agendaSize in interface Agenda
Returns:
total number of activations on the focus stack

getActivations

public Activation[] getActivations()
Specified by:
getActivations in interface Agenda

getScheduledActivations

public Activation[] getScheduledActivations()
Specified by:
getScheduledActivations in interface Agenda

clearAgenda

public void clearAgenda()
Description copied from interface: Agenda
Clears all Activations from the Agenda

Specified by:
clearAgenda in interface Agenda

clearAgendaGroup

public void clearAgendaGroup(String name)
Description copied from interface: Agenda
Clears all Activations from an Agenda Group. Any Activations that are also in an Xor Group are removed the the Xor Group.

Specified by:
clearAgendaGroup in interface Agenda

clearAgendaGroup

public void clearAgendaGroup(AgendaGroup agendaGroup)
Description copied from interface: Agenda
Clears all Activations from an Agenda Group. Any Activations that are also in an Xor Group are removed the the Xor Group.

Specified by:
clearAgendaGroup in interface Agenda

clearActivationGroup

public void clearActivationGroup(String name)
Description copied from interface: Agenda
Clears all Activations from an Activation-Group. Any Activations that are also in an Agenda Group are removed from the Agenda Group.

Specified by:
clearActivationGroup in interface Agenda

clearActivationGroup

public void clearActivationGroup(ActivationGroup activationGroup)
Description copied from interface: Agenda
Clears all Activations from an Xor Group. Any Activations that are also in an Agenda Group are removed from the Agenda Group.

Specified by:
clearActivationGroup in interface Agenda

fireNextItem

public boolean fireNextItem(AgendaFilter filter)
                     throws ConsequenceException
Fire the next scheduled Agenda item.

Specified by:
fireNextItem in interface InternalAgenda
Throws:
ConsequenceException - If an error occurs while firing an agenda item.

fireActivation

public void fireActivation(Activation activation)
                    throws ConsequenceException
Fire this item.

Specified by:
fireActivation in interface InternalAgenda
Parameters:
workingMemory - The working memory context.
Throws:
ConsequenceException - If an error occurs while attempting to fire the consequence.

increaseActiveActivations

public void increaseActiveActivations()
Specified by:
increaseActiveActivations in interface InternalAgenda

decreaseActiveActivations

public void decreaseActiveActivations()
Specified by:
decreaseActiveActivations in interface InternalAgenda

increaseDormantActivations

public void increaseDormantActivations()
Specified by:
increaseDormantActivations in interface InternalAgenda

decreaseDormantActivations

public void decreaseDormantActivations()
Specified by:
decreaseDormantActivations in interface InternalAgenda

getActiveActivations

public int getActiveActivations()
Specified by:
getActiveActivations in interface InternalAgenda

getDormantActivations

public int getDormantActivations()
Specified by:
getDormantActivations in interface InternalAgenda


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