Package org.drools.core.common
Class RuleFlowGroupImpl
- java.lang.Object
-
- org.drools.core.common.RuleFlowGroupImpl
-
- All Implemented Interfaces:
InternalAgendaGroup,InternalRuleFlowGroup,AgendaGroup,RuleFlowGroup,org.kie.api.runtime.rule.AgendaGroup,org.kie.api.runtime.rule.RuleFlowGroup
public class RuleFlowGroupImpl extends Object implements InternalRuleFlowGroup, InternalAgendaGroup
Implementation of aRuleFlowGroupthat 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,RuleFlowGroupsare automatically deactivated when there are no more activations in theRuleFlowGroup. However, this can be configured.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRuleFlowGroupImpl.DeactivateCallback
-
Field Summary
-
Fields inherited from interface org.drools.core.spi.AgendaGroup
MAIN
-
-
Constructor Summary
Constructors Constructor Description RuleFlowGroupImpl()RuleFlowGroupImpl(String name, boolean active, boolean autoDeactivate)RuleFlowGroupImpl(String name, InternalKnowledgeBase kBase)Construct aRuleFlowGroupImplwith the given name.
-
Method Summary
-
-
-
Constructor Detail
-
RuleFlowGroupImpl
public RuleFlowGroupImpl()
-
RuleFlowGroupImpl
public RuleFlowGroupImpl(String name, InternalKnowledgeBase kBase)
Construct aRuleFlowGroupImplwith the given name.- Parameters:
name- The RuleFlowGroup name.
-
RuleFlowGroupImpl
public RuleFlowGroupImpl(String name, boolean active, boolean autoDeactivate)
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getNamein interfaceorg.kie.api.runtime.rule.AgendaGroup- Specified by:
getNamein interfaceRuleFlowGroup- Specified by:
getNamein interfaceorg.kie.api.runtime.rule.RuleFlowGroup
-
setWorkingMemory
public void setWorkingMemory(InternalWorkingMemory workingMemory)
- Specified by:
setWorkingMemoryin interfaceInternalAgendaGroup
-
getWorkingMemory
public InternalWorkingMemory getWorkingMemory()
- Specified by:
getWorkingMemoryin interfaceInternalAgendaGroup
-
hasRuleFlowListener
public void hasRuleFlowListener(boolean hasRuleFlowLister)
- Specified by:
hasRuleFlowListenerin interfaceInternalAgendaGroup
-
isRuleFlowListener
public boolean isRuleFlowListener()
- Specified by:
isRuleFlowListenerin interfaceInternalAgendaGroup
-
remove
public Activation remove()
- Specified by:
removein interfaceInternalAgendaGroup
-
peek
public Activation peek()
- Specified by:
peekin interfaceInternalAgendaGroup
-
setActive
public void setActive(boolean active)
- Specified by:
setActivein interfaceInternalAgendaGroup
-
isActive
public boolean isActive()
- Specified by:
isActivein interfaceAgendaGroup- Specified by:
isActivein interfaceRuleFlowGroup- Returns:
- boolean value indicating if the AgendaGroup is active and thus being evaluated.
-
setAutoFocusActivator
public void setAutoFocusActivator(PropagationContext ctx)
- Specified by:
setAutoFocusActivatorin interfaceAgendaGroup
-
getAutoFocusActivator
public PropagationContext getAutoFocusActivator()
- Specified by:
getAutoFocusActivatorin interfaceAgendaGroup
-
isAutoDeactivate
public boolean isAutoDeactivate()
- Specified by:
isAutoDeactivatein interfaceInternalAgendaGroup- Specified by:
isAutoDeactivatein interfaceRuleFlowGroup
-
setAutoDeactivate
public void setAutoDeactivate(boolean autoDeactivate)
Description copied from interface:InternalAgendaGroupSets 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:
setAutoDeactivatein interfaceInternalAgendaGroup- Specified by:
setAutoDeactivatein interfaceRuleFlowGroup
-
clear
public void clear()
- Specified by:
clearin interfaceorg.kie.api.runtime.rule.AgendaGroup- Specified by:
clearin interfaceorg.kie.api.runtime.rule.RuleFlowGroup
-
reset
public void reset()
- Specified by:
resetin interfaceInternalAgendaGroup
-
setFocus
public void setFocus()
- Specified by:
setFocusin interfaceorg.kie.api.runtime.rule.AgendaGroup
-
getAndClear
public Activation[] getAndClear()
- Specified by:
getAndClearin interfaceInternalAgendaGroup
-
add
public void add(Activation activation)
- Specified by:
addin interfaceInternalAgendaGroup
-
addActivation
public void addActivation(Activation activation)
-
remove
public void remove(Activation activation)
- Specified by:
removein interfaceInternalAgendaGroup
-
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()
- Specified by:
isEmptyin interfaceAgendaGroup- Specified by:
isEmptyin interfaceRuleFlowGroup- Returns:
- boolean value indicating if this AgendaGroup is empty or not
-
getActivations
public Activation[] getActivations()
- Specified by:
getActivationsin interfaceAgendaGroup- Specified by:
getActivationsin interfaceInternalAgendaGroup- Returns:
- An immutable Collection of all the activations in the AgendaGroup
-
iterator
public Iterator iterator()
-
addNodeInstance
public void addNodeInstance(Object processInstanceId, String nodeInstanceId)
- Specified by:
addNodeInstancein interfaceInternalAgendaGroup
-
removeNodeInstance
public void removeNodeInstance(Object processInstanceId, String nodeInstanceId)
- Specified by:
removeNodeInstancein interfaceInternalAgendaGroup
-
getNodeInstances
public Map<Object,String> getNodeInstances()
- Specified by:
getNodeInstancesin interfaceInternalAgendaGroup
-
setActivatedForRecency
public void setActivatedForRecency(long recency)
- Specified by:
setActivatedForRecencyin interfaceInternalAgendaGroup
-
getActivatedForRecency
public long getActivatedForRecency()
- Specified by:
getActivatedForRecencyin interfaceInternalAgendaGroup
-
setClearedForRecency
public void setClearedForRecency(long recency)
- Specified by:
setClearedForRecencyin interfaceInternalAgendaGroup
-
getClearedForRecency
public long getClearedForRecency()
- Specified by:
getClearedForRecencyin interfaceInternalAgendaGroup
-
visited
public void visited()
- Specified by:
visitedin interfaceInternalAgendaGroup
-
size
public int size()
- Specified by:
sizein interfaceAgendaGroup- Specified by:
sizein interfaceRuleFlowGroup- Returns:
- The int total number of activations
-
isSequential
public boolean isSequential()
- Specified by:
isSequentialin interfaceInternalAgendaGroup
-
-