org.drools.common
Class RuleFlowGroupImpl

java.lang.Object
  extended by org.drools.ruleflow.instance.impl.RuleFlowNodeInstanceImpl
      extended by org.drools.ruleflow.instance.impl.RuleFlowSequenceNodeInstanceImpl
          extended by org.drools.common.RuleFlowGroupImpl
All Implemented Interfaces:
java.io.Serializable, InternalRuleFlowGroup, RuleFlowNodeInstance, RuleFlowGroup

public class RuleFlowGroupImpl
extends RuleFlowSequenceNodeInstanceImpl
implements InternalRuleFlowGroup

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.

Author:
Mark Proctor, Kris Verlaenen
See Also:
Serialized Form

Nested Class Summary
static class RuleFlowGroupImpl.DeactivateCallback
           
 
Constructor Summary
RuleFlowGroupImpl(java.lang.String name)
          Construct a RuleFlowGroupImpl with the given name.
 
Method Summary
 void addActivation(Activation activation)
           
 void clear()
           
 boolean equal(java.lang.Object object)
           
 java.lang.String getName()
           
 InternalWorkingMemory getWorkingMemory()
           
 int hashCode()
           
 boolean isActive()
           
 boolean isAutoDeactivate()
           
 boolean isEmpty()
           
 java.util.Iterator iterator()
           
 void removeActivation(Activation activation)
           
 void setActive(boolean active)
          Activates or deactivates this RuleFlowGroup.
 void setAutoDeactivate(boolean autoDeactivate)
          Sets the auto-deactivate status of this RuleFlowGroup.
 void setWorkingMemory(InternalWorkingMemory workingMemory)
           
 int size()
           
 java.lang.String toString()
           
 void trigger(RuleFlowNodeInstance parent)
           
 
Methods inherited from class org.drools.ruleflow.instance.impl.RuleFlowSequenceNodeInstanceImpl
cancel, getRuleSetNode, triggerCompleted
 
Methods inherited from class org.drools.ruleflow.instance.impl.RuleFlowNodeInstanceImpl
getId, getNode, getNodeId, getProcessInstance, setId, setNodeId, setProcessInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.drools.common.InternalRuleFlowGroup
getProcessInstance, triggerCompleted
 

Constructor Detail

RuleFlowGroupImpl

public RuleFlowGroupImpl(java.lang.String name)
Construct a RuleFlowGroupImpl with the given name.

Parameters:
name - The RuleFlowGroup name.
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface RuleFlowGroup

setWorkingMemory

public void setWorkingMemory(InternalWorkingMemory workingMemory)
Specified by:
setWorkingMemory in interface InternalRuleFlowGroup

getWorkingMemory

public InternalWorkingMemory getWorkingMemory()
Specified by:
getWorkingMemory in interface InternalRuleFlowGroup

setActive

public void setActive(boolean active)
Description copied from interface: InternalRuleFlowGroup
Activates or deactivates this RuleFlowGroup. When activating, all activations of this RuleFlowGroup are added to the agenda. As long as the RuleFlowGroup remains active, its activations are automatically added to the agenda. When deactivating, all activations of this RuleFlowGroup are removed to the agenda. As long as the RuleFlowGroup remains deactive, its activations are not added to the agenda.

Specified by:
setActive in interface InternalRuleFlowGroup

isActive

public boolean isActive()
Specified by:
isActive in interface InternalRuleFlowGroup
Specified by:
isActive in interface RuleFlowGroup

isAutoDeactivate

public boolean isAutoDeactivate()
Specified by:
isAutoDeactivate in interface RuleFlowGroup

setAutoDeactivate

public void setAutoDeactivate(boolean autoDeactivate)
Description copied from interface: RuleFlowGroup
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 RuleFlowGroup

clear

public void clear()
Specified by:
clear in interface InternalRuleFlowGroup

size

public int size()
Specified by:
size in interface RuleFlowGroup

addActivation

public void addActivation(Activation activation)
Specified by:
addActivation in interface InternalRuleFlowGroup

removeActivation

public void removeActivation(Activation activation)
Specified by:
removeActivation in interface InternalRuleFlowGroup

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface RuleFlowGroup

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface RuleFlowGroup

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equal

public boolean equal(java.lang.Object object)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

trigger

public void trigger(RuleFlowNodeInstance parent)
Specified by:
trigger in interface RuleFlowNodeInstance
Overrides:
trigger in class RuleFlowSequenceNodeInstanceImpl