org.drools.core.common
Class RuleFlowGroupImpl
java.lang.Object
org.drools.core.common.RuleFlowGroupImpl
- All Implemented Interfaces:
- InternalAgendaGroup, InternalRuleFlowGroup, org.kie.api.runtime.rule.AgendaGroup, org.kie.api.runtime.rule.RuleFlowGroup
public class RuleFlowGroupImpl
- extends Object
- implements InternalRuleFlowGroup, InternalAgendaGroup
Implementation of a RuleFlowGroup that collects activations
of rules of this ruleflow-group.
If this group is activated, all its activations are added to the agenda.
As long as this group is active, its activations are added to the agenda.
Deactivating the group removes all its activations from the agenda and
collects them until it is activated again.
By default, RuleFlowGroups are automatically deactivated when there are no more
activations in the RuleFlowGroup. However, this can be configured.
RuleFlowGroupImpl
public RuleFlowGroupImpl()
RuleFlowGroupImpl
public RuleFlowGroupImpl(String name,
InternalRuleBase rbase)
- Construct a
RuleFlowGroupImpl with the given name.
- Parameters:
name - The RuleFlowGroup name.
RuleFlowGroupImpl
public RuleFlowGroupImpl(String name,
boolean active,
boolean autoDeactivate)
getName
public String getName()
- Specified by:
getName in interface org.kie.api.runtime.rule.AgendaGroup- Specified by:
getName in interface org.kie.api.runtime.rule.RuleFlowGroup
setWorkingMemory
public void setWorkingMemory(InternalWorkingMemory workingMemory)
- Specified by:
setWorkingMemory in interface InternalAgendaGroup
getWorkingMemory
public InternalWorkingMemory getWorkingMemory()
- Specified by:
getWorkingMemory in interface InternalAgendaGroup
hasRuleFlowListener
public void hasRuleFlowListener(boolean hasRuleFlowLister)
- Specified by:
hasRuleFlowListener in interface InternalAgendaGroup
isRuleFlowListener
public boolean isRuleFlowListener()
- Specified by:
isRuleFlowListener in interface InternalAgendaGroup
remove
public Activation remove()
- Specified by:
remove in interface InternalAgendaGroup
peek
public Activation peek()
- Specified by:
peek in interface InternalAgendaGroup
setActive
public void setActive(boolean active)
- Specified by:
setActive in interface InternalAgendaGroup
isActive
public boolean isActive()
- Returns:
- boolean value indicating if the AgendaGroup is active and thus being evaluated.
setAutoFocusActivator
public void setAutoFocusActivator(PropagationContext ctx)
getAutoFocusActivator
public PropagationContext getAutoFocusActivator()
isAutoDeactivate
public boolean isAutoDeactivate()
- Specified by:
isAutoDeactivate in interface InternalAgendaGroup
setAutoDeactivate
public void setAutoDeactivate(boolean autoDeactivate)
- Description copied from interface:
InternalAgendaGroup
- Sets the auto-deactivate status of this RuleFlowGroup.
If this is set to true, an active RuleFlowGroup automatically
deactivates if it has no more activations. If it had no
activations when it was activated, it will be deactivated immediately.
- Specified by:
setAutoDeactivate in interface InternalAgendaGroup
clear
public void clear()
- Specified by:
clear in interface InternalAgendaGroup- Specified by:
clear in interface org.kie.api.runtime.rule.AgendaGroup- Specified by:
clear in interface org.kie.api.runtime.rule.RuleFlowGroup
setFocus
public void setFocus()
- Specified by:
setFocus in interface org.kie.api.runtime.rule.AgendaGroup
getAndClear
public Activation[] getAndClear()
- Specified by:
getAndClear in interface InternalAgendaGroup
add
public void add(Activation activation)
- Specified by:
add in interface InternalAgendaGroup
addActivation
public void addActivation(Activation activation)
remove
public void remove(Activation activation)
- Specified by:
remove in interface InternalAgendaGroup
removeActivation
public void removeActivation(Activation activation)
deactivateIfEmpty
public void deactivateIfEmpty()
- Checks if this ruleflow group is active and should automatically deactivate.
If the queue is empty, it deactivates the group.
addRuleFlowGroupListener
public void addRuleFlowGroupListener(RuleFlowGroupListener listener)
removeRuleFlowGroupListener
public void removeRuleFlowGroupListener(RuleFlowGroupListener listener)
notifyRuleFlowGroupListeners
public void notifyRuleFlowGroupListeners()
isEmpty
public boolean isEmpty()
- Returns:
- boolean value indicating if this AgendaGroup is empty or not
getActivations
public Activation[] getActivations()
- Specified by:
getActivations in interface InternalAgendaGroup
- Returns:
- An immutable Collection of all the activations in the AgendaGroup
iterator
public Iterator iterator()
addNodeInstance
public void addNodeInstance(Long processInstanceId,
String nodeInstanceId)
- Specified by:
addNodeInstance in interface InternalAgendaGroup
removeNodeInstance
public void removeNodeInstance(Long processInstanceId,
String nodeInstanceId)
- Specified by:
removeNodeInstance in interface InternalAgendaGroup
getNodeInstances
public Map<Long,String> getNodeInstances()
- Specified by:
getNodeInstances in interface InternalAgendaGroup
setActivatedForRecency
public void setActivatedForRecency(long recency)
- Specified by:
setActivatedForRecency in interface InternalAgendaGroup
getActivatedForRecency
public long getActivatedForRecency()
- Specified by:
getActivatedForRecency in interface InternalAgendaGroup
setClearedForRecency
public void setClearedForRecency(long recency)
- Specified by:
setClearedForRecency in interface InternalAgendaGroup
getClearedForRecency
public long getClearedForRecency()
- Specified by:
getClearedForRecency in interface InternalAgendaGroup
toString
public String toString()
- Overrides:
toString in class Object
size
public int size()
- Returns:
- The int total number of activations
equals
public boolean equals(Object object)
- Overrides:
equals in class Object
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
Copyright © 2001-2013 JBoss by Red Hat. All Rights Reserved.