public void clearAndCancelActivationGroup(final ActivationGroup activationGroup) { final EventSupport eventsupport = (EventSupport) this.workingMemory; for ( final Iterator it = activationGroup.iterator(); it.hasNext(); ) { final ActivationGroupNode node = (ActivationGroupNode) it.next(); final Activation activation = node.getActivation(); activation.setActivationGroupNode( null ); if ( activation.isActivated() ) { activation.setActivated( false ); activation.remove(); if ( activation.getActivationNode() != null ) { final InternalRuleFlowGroup ruleFlowGroup = (InternalRuleFlowGroup) activation.getActivationNode().getParentContainer(); ruleFlowGroup.removeActivation( activation ); } eventsupport.getAgendaEventSupport().fireActivationCancelled( activation, this.workingMemory, ActivationCancelledCause.CLEAR ); } } activationGroup.clear(); }
public void unstageActivations() { if ( !declarativeAgenda || getStageActivationsGroup().isEmpty() ) { return; } org.drools.core.util.LinkedList<ActivationGroupNode> list = getStageActivationsGroup().getList(); for ( ActivationGroupNode node = list.removeFirst(); node != null; node = list.removeFirst() ) { AgendaItem item = ( AgendaItem ) node.getActivation(); item.setActivationGroupNode( null ); addActivation( item, false ); } notifyHalt(); }
public void clearAndCancelStagedActivations() { if ( getStageActivationsGroup().isEmpty() ) { return; } org.drools.core.util.LinkedList<ActivationGroupNode> list = getStageActivationsGroup().getList(); final EventSupport eventsupport = (EventSupport) this.workingMemory; for ( ActivationGroupNode node = list.removeFirst(); node != null; node = list.removeFirst() ) { AgendaItem item = ( AgendaItem ) node.getActivation(); // This must be set to false otherwise modify won't work properly item.setActivated( false ); eventsupport.getAgendaEventSupport().fireActivationCancelled( item, this.workingMemory, ActivationCancelledCause.CLEAR ); } }