activation.setActivated( activated );
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 ); } }
public void clearAndCancelAgendaGroup(final AgendaGroup agendaGroup) { final EventSupport eventsupport = (EventSupport) this.workingMemory; // this is thread safe for BinaryHeapQueue // Binary Heap locks while it returns the array and reset's it's own internal array. Lock is released afer getAndClear() for (Activation aQueueable : ((InternalAgendaGroup) agendaGroup).getAndClear()) { final AgendaItem item = (AgendaItem) aQueueable; if (item == null) { continue; } // this must be set false before removal from the activationGroup. // Otherwise the activationGroup will also try to cancel the Actvation // Also modify won't work properly item.setActivated(false); if (item.getActivationGroupNode() != null) { item.getActivationGroupNode().getActivationGroup().removeActivation(item); } if (item.getActivationNode() != null) { final InternalRuleFlowGroup ruleFlowGroup = (InternalRuleFlowGroup) item.getActivationNode().getParentContainer(); ruleFlowGroup.removeActivation(item); } eventsupport.getAgendaEventSupport().fireActivationCancelled( item, this.workingMemory, ActivationCancelledCause.CLEAR ); } }
public void clearAndCancelAndCancel(final RuleFlowGroup ruleFlowGroup) { final EventSupport eventsupport = (EventSupport) this.workingMemory; for (ActivationNode node : ruleFlowGroup) { AgendaItem item = (AgendaItem) node.getActivation(); if (item != null) { item.setActivated(false); item.remove(); if (item.getActivationGroupNode() != null) { item.getActivationGroupNode().getActivationGroup().removeActivation(item); } } eventsupport.getAgendaEventSupport().fireActivationCancelled( item, this.workingMemory, ActivationCancelledCause.CLEAR ); } ruleFlowGroup.clear(); if ( ruleFlowGroup.isActive() && ruleFlowGroup.isAutoDeactivate() ) { // deactivate callback WorkingMemoryAction action = new DeactivateCallback( (InternalRuleFlowGroup) ruleFlowGroup ); this.workingMemory.queueWorkingMemoryAction( action ); } }
item.setActivated( true ); tuple.increaseActivationCountForEvents(); increaseActiveActivations(); return false; item.setActivated( true ); tuple.increaseActivationCountForEvents(); increaseActiveActivations();
return false; item.setActivated( true ); tuple.increaseActivationCountForEvents(); increaseActiveActivations();