|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.drools.common.DefaultAgenda
public class DefaultAgenda
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.
| 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 AgendGroup |
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 |
|---|
public int activeActivations
public int dormantActivations
| Constructor Detail |
|---|
public DefaultAgenda(InternalWorkingMemory workingMemory)
workingMemory - The WorkingMemory of this agenda.conflictResolver - The conflict resolver.| Method Detail |
|---|
public WorkingMemory getWorkingMemory()
getWorkingMemory in interface Agendapublic void scheduleItem(ScheduledAgendaItem item)
scheduleItem in interface InternalAgendaitem - The item to schedule.public void removeScheduleItem(ScheduledAgendaItem item)
removeScheduleItem in interface InternalAgendapublic LinkedList getScheduledItems()
getScheduledItems in interface Agendapublic void addAgendaGroup(AgendaGroup agendaGroup)
addAgendaGroup in interface InternalAgendapublic boolean setFocus(AgendaGroup agendaGroup)
public void setFocus(String name)
public AgendaGroup getFocus()
public AgendaGroup getNextFocus()
public void setCurrentAgendaGroup(AgendaGroup agendaGroup)
public AgendaGroup getCurrentAgendaGroup()
public AgendaGroup getAgendaGroup(String name)
getAgendaGroup in interface Agendapublic AgendaGroup[] getAgendaGroups()
getAgendaGroups in interface Agendapublic AgendaGroup[] getStack()
public ActivationGroup getActivationGroup(String name)
getActivationGroup in interface Agendapublic RuleFlowGroup getRuleFlowGroup(String name)
getRuleFlowGroup in interface Agendapublic void activateRuleFlowGroup(String name)
AgendaRuleFlowGroup 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 Agendapublic void deactivateRuleFlowGroup(String name)
AgendaRuleFlowGroup 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
deactivateRuleFlowGroup in interface Agendapublic int focusStackSize()
AgendaAgendGroups 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
public int agendaSize()
AgendaActivations
agendaSize in interface Agendapublic Activation[] getActivations()
getActivations in interface Agendapublic Activation[] getScheduledActivations()
getScheduledActivations in interface Agendapublic void clearAgenda()
Agenda
clearAgenda in interface Agendapublic void clearAgendaGroup(String name)
Agenda
clearAgendaGroup in interface Agendapublic void clearAgendaGroup(AgendaGroup agendaGroup)
Agenda
clearAgendaGroup in interface Agendapublic void clearActivationGroup(String name)
Agenda
clearActivationGroup in interface Agendapublic void clearActivationGroup(ActivationGroup activationGroup)
Agenda
clearActivationGroup in interface Agendapublic boolean fireNextItem(AgendaFilter filter) throws ConsequenceException
Agenda item.
fireNextItem in interface InternalAgendaConsequenceException - If an error occurs while firing an agenda item.public void fireActivation(Activation activation) throws ConsequenceException
fireActivation in interface InternalAgendaworkingMemory - The working memory context.
ConsequenceException - If an error occurs while attempting to fire the consequence.public void increaseActiveActivations()
increaseActiveActivations in interface InternalAgendapublic void decreaseActiveActivations()
decreaseActiveActivations in interface InternalAgendapublic void increaseDormantActivations()
increaseDormantActivations in interface InternalAgendapublic void decreaseDormantActivations()
decreaseDormantActivations in interface InternalAgendapublic int getActiveActivations()
getActiveActivations in interface InternalAgendapublic int getDormantActivations()
getDormantActivations in interface InternalAgenda
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||