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 boolean addActivation(final AgendaItem activation) { if ( declarativeAgenda ) { if ( activationObjectTypeConf == null ) { EntryPoint ep = workingMemory.getEntryPoint(); activationObjectTypeConf = ((InternalWorkingMemoryEntryPoint) workingMemory.getWorkingMemoryEntryPoint( ep.getEntryPointId() )).getObjectTypeConfigurationRegistry().getObjectTypeConf( ep, activation ); } InternalFactHandle factHandle = workingMemory.getFactHandleFactory().newFactHandle( activation, activationObjectTypeConf, workingMemory, workingMemory ); workingMemory.getEntryPointNode().assertActivation( factHandle, activation.getPropagationContext(), workingMemory ); activation.setFactHandle( factHandle ); if ( !activation.isCanceled() && ( activation.getBlockers() == null || activation.getBlockers().isEmpty() ) ) { // All activations started off staged, they are unstaged if they are blocked or // allowed to move onto the actual agenda for firing. getStageActivationsGroup().addActivation( activation ); } return true; } else { addActivation( activation, true ); return true; } }
} else { if ( !previouslyActive ) { addActivation( activation, true ); } else { Timer timer = activation.getRule().getTimer();