|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 Activation s |
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 Agenda
public void scheduleItem(ScheduledAgendaItem item)
scheduleItem
in interface InternalAgenda
item
- The item to schedule.public void removeScheduleItem(ScheduledAgendaItem item)
removeScheduleItem
in interface InternalAgenda
public LinkedList getScheduledItems()
getScheduledItems
in interface Agenda
public void addAgendaGroup(AgendaGroup agendaGroup)
addAgendaGroup
in interface InternalAgenda
public 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 Agenda
public AgendaGroup[] getAgendaGroups()
getAgendaGroups
in interface Agenda
public AgendaGroup[] getStack()
public ActivationGroup getActivationGroup(String name)
getActivationGroup
in interface Agenda
public RuleFlowGroup getRuleFlowGroup(String name)
getRuleFlowGroup
in interface Agenda
public void activateRuleFlowGroup(String name)
Agenda
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
in interface Agenda
public void deactivateRuleFlowGroup(String name)
Agenda
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
deactivateRuleFlowGroup
in interface Agenda
public int focusStackSize()
Agenda
AgendGroups in the focus stack returning the total number of Activation
s
- Specified by:
focusStackSize
in interface Agenda
- Returns:
- total number of
Activation
s on the focus stack
public int agendaSize()
Agenda
Activation
s
agendaSize
in interface Agenda
public Activation[] getActivations()
getActivations
in interface Agenda
public Activation[] getScheduledActivations()
getScheduledActivations
in interface Agenda
public void clearAgenda()
Agenda
clearAgenda
in interface Agenda
public void clearAgendaGroup(String name)
Agenda
clearAgendaGroup
in interface Agenda
public void clearAgendaGroup(AgendaGroup agendaGroup)
Agenda
clearAgendaGroup
in interface Agenda
public void clearActivationGroup(String name)
Agenda
clearActivationGroup
in interface Agenda
public void clearActivationGroup(ActivationGroup activationGroup)
Agenda
clearActivationGroup
in interface Agenda
public boolean fireNextItem(AgendaFilter filter) throws ConsequenceException
Agenda
item.
fireNextItem
in interface InternalAgenda
ConsequenceException
- If an error occurs while firing an agenda item.public void fireActivation(Activation activation) throws ConsequenceException
fireActivation
in interface InternalAgenda
workingMemory
- The working memory context.
ConsequenceException
- If an error occurs while attempting to fire the consequence.public void increaseActiveActivations()
increaseActiveActivations
in interface InternalAgenda
public void decreaseActiveActivations()
decreaseActiveActivations
in interface InternalAgenda
public void increaseDormantActivations()
increaseDormantActivations
in interface InternalAgenda
public void decreaseDormantActivations()
decreaseDormantActivations
in interface InternalAgenda
public int getActiveActivations()
getActiveActivations
in interface InternalAgenda
public int getDormantActivations()
getDormantActivations
in interface InternalAgenda
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |