public DefaultAgenda createAgenda( InternalRuleBase ruleBase ) { return new DefaultAgenda( ruleBase ); }
public AgendaGroup getAgendaGroup(final String name, InternalRuleBase ruleBase) { String groupName = (name == null || name.length() == 0) ? AgendaGroup.MAIN : name; AgendaGroup agendaGroup = this.agendaGroups.get( groupName ); if ( agendaGroup == null ) { // The AgendaGroup is defined but not yet added to the // Agenda, so create the AgendaGroup and add to the Agenda. agendaGroup = agendaGroupFactory.createAgendaGroup( name, ruleBase ); addAgendaGroup( agendaGroup ); } return agendaGroup; }
public void clearAndCancelActivationGroup(final String name) { final ActivationGroup activationGroup = this.activationGroups.get( name ); if ( activationGroup != null ) { clearAndCancelActivationGroup( activationGroup ); } }
ObjectInputStream stream = context.stream; agenda.setDormantActivations( stream.readInt() ); agenda.setActiveActivations( stream.readInt() ); context.ruleBase ); group.setActive( stream.readBoolean() ); agenda.getAgendaGroupsMap().put( group.getName(), group ); agenda.addAgendaGroupOnStack( agenda.getAgendaGroup( agendaGroupName ) ); active, autoDeactivate ); agenda.getRuleFlowGroupsMap().put( rfgName, rfg ); int nbNodeInstances = stream.readInt();
this.setFocus( item.getPropagationContext(), rule.getAgendaGroup() ); addItemToActivationGroup( item ); scheduleItem( sitem, workingMemory ); } else { InternalAgendaGroup agendaGroup = (InternalAgendaGroup) this.getAgendaGroup( rule.getAgendaGroup() ); } else { InternalRuleFlowGroup rfg = (InternalRuleFlowGroup) this.getRuleFlowGroup( rule.getRuleFlowGroup() ); rfg.addActivation( item ); mustNotifyHalt = true; } else { notifyHalt();
InternalAgendaGroup group = (InternalAgendaGroup) agenda.getAgendaGroup( _agendaGroup.getName(), context.ruleBase ); group.setActive( _agendaGroup.getIsActive() ); agenda.getAgendaGroupsMap().put( group.getName(), group ); agenda.addAgendaGroupOnStack( agenda.getAgendaGroup( _groupName ) ); _ruleFlowGroup.getIsActive(), _ruleFlowGroup.getIsAutoDeactivate() ); agenda.getRuleFlowGroupsMap().put( _ruleFlowGroup.getName(), rfgi ); agenda.setActivationsFilter( context.filter );
isFiringActivation = true; try { increaseDormantActivations(); decreaseActiveActivations(); clearAndCancelActivationGroup( activationGroup ); this.workingMemory ); unstageActivations(); } finally { isFiringActivation = false; if (mustNotifyHalt) { mustNotifyHalt = false; notifyHalt();
clearAndCancelAgendaGroup(internalAgendaGroup); clearAndCancelStagedActivations(); clearAndCancelAndCancel( group ); clearAndCancelActivationGroup( group );
ActivationGroup activationGroup = getStageActivationsGroup(); if ( activation.getActivationGroupNode() != null && activation.getActivationGroupNode().getActivationGroup() == activationGroup ) { } else { if ( !previouslyActive ) { addActivation( activation, true ); } else { Timer timer = activation.getRule().getTimer(); if ( timer != null && timer instanceof ExpressionIntervalTimer ) { ScheduledAgendaItem schItem = ( ScheduledAgendaItem ) activation; removeScheduleItem( schItem ); scheduleItem( schItem, workingMemory );
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(); }
/** * @inheritDoc */ public boolean isRuleActiveInRuleFlowGroup(String ruleflowGroupName, String ruleName, long processInstanceId) { RuleFlowGroup systemRuleFlowGroup = this.getRuleFlowGroup( ruleflowGroupName ); for (ActivationNode aSystemRuleFlowGroup : systemRuleFlowGroup) { Activation activation = aSystemRuleFlowGroup.getActivation(); if (ruleName.equals(activation.getRule().getName())) { if (checkProcessInstance(activation, processInstanceId)) { return true; } } } return false; }
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; } }
public void clearAndCancelRuleFlowGroup(final String name) { final RuleFlowGroup ruleFlowGrlup = this.ruleFlowGroups.get( name ); if ( ruleFlowGrlup != null ) { clearAndCancelAndCancel( ruleFlowGrlup ); } }
public void clearAndCancelAgendaGroup(final String name) { final AgendaGroup agendaGroup = this.agendaGroups.get( name ); if ( agendaGroup != null ) { clearAndCancelAgendaGroup( agendaGroup ); } }
public DefaultAgenda createAgenda( InternalRuleBase ruleBase, boolean initMain ) { return new DefaultAgenda( ruleBase, initMain ); }