public void delete(LogicalDependency node, BeliefSet beliefSet, PropagationContext context) { beliefSet.remove( node.getJustifierEntry() ); WorkingMemoryAction action = new LogicalRetractCallback( tms, node, beliefSet, (InternalFactHandle) node.getJustified(), context, node.getJustifier() ); wm.queueWorkingMemoryAction( action ); }
/** * This class is not thread safe, changes to the working memory during * iteration may give unexpected results */ public Iterator iterateFactHandles(org.drools.runtime.ObjectFilter filter) { return getObjectStore().iterateFactHandles( filter ); }
public int compare(EqualityKey key1, EqualityKey key2) { return key1.getFactHandle().getId() - key2.getFactHandle().getId(); } }
public void removeActivation(final AgendaItem activation) { if ( declarativeAgenda ) { workingMemory.getEntryPointNode().retractActivation( activation.getFactHandle(), activation.getPropagationContext(), workingMemory ); if ( activation.getActivationGroupNode() != null ) { activation.getActivationGroupNode().getActivationGroup().removeActivation( activation ); } } if ( activation instanceof ScheduledAgendaItem ) { removeScheduleItem( (ScheduledAgendaItem) activation ); } }
public NamedEntryPoint(EntryPoint entryPoint, EntryPointNode entryPointNode, AbstractWorkingMemory wm, ReentrantLock lock) { this.entryPoint = entryPoint; this.entryPointNode = entryPointNode; this.wm = wm; this.ruleBase = (InternalRuleBase) this.wm.getRuleBase(); this.lock = lock; this.typeConfReg = new ObjectTypeConfigurationRegistry( this.ruleBase ); this.handleFactory = this.wm.getFactHandleFactory(); this.objectStore = new SingleThreadedObjectStore( this.ruleBase.getConfiguration(), this.lock ); }
public void activateRuleFlowGroup(final String name, long processInstanceId, String nodeInstanceId) { InternalRuleFlowGroup ruleFlowGroup = (InternalRuleFlowGroup) getRuleFlowGroup( name ); ruleFlowGroup.addNodeInstance(processInstanceId, nodeInstanceId); ruleFlowGroup.setActive( true ); }
public RuleFlowGroup getRuleFlowGroup(final String name) { RuleFlowGroup ruleFlowGroup = this.ruleFlowGroups.get( name ); if ( ruleFlowGroup == null ) { ruleFlowGroup = new RuleFlowGroupImpl( name ); ((InternalRuleFlowGroup) ruleFlowGroup).setWorkingMemory( (InternalWorkingMemory) getWorkingMemory() ); this.ruleFlowGroups.put( name, ruleFlowGroup ); } return ruleFlowGroup; }
public void updateSinkOnAttach( BuildContext context, InternalWorkingMemory workingMemory ) { final PropagationContext propagationContext = new PropagationContextImpl(workingMemory.getNextPropagationIdCounter(), PropagationContext.RULE_ADDITION, null, null, null); this.updateSinkOnAttach( context, propagationContext, workingMemory ); propagationContext.evaluateActionQueue( workingMemory ); }
/** * This class is not thread safe, changes to the working memory during * iteration may give unexpected results */ public Iterator iterateObjects() { return getObjectStore().iterateObjects(); }
public void removeRuleFlowGroupListener(String ruleFlowGroup, RuleFlowGroupListener listener) { InternalRuleFlowGroup rfg = (InternalRuleFlowGroup) this.getRuleFlowGroup( ruleFlowGroup ); rfg.removeRuleFlowGroupListener( listener ); }
public void execute( final ObjectSinkPropagator sink, final InternalWorkingMemory workingMemory ) { if ( handle.isEvent() ) { (( EventFactHandle ) handle).decPendingActions(); } } }
/** Side-effects, will add the created key to the handle. */ private EqualityKey createEqualityKey(InternalFactHandle handle) { EqualityKey key = new EqualityKey( handle ); handle.setEqualityKey( key ); return key; }
public void read(LogicalDependency node, BeliefSet beliefSet, PropagationContext context, ObjectTypeConf typeConf) { beliefSet.add( node.getJustifierEntry() ); }
public Action(InternalFactHandle handle, PropagationContext context) { super(); if ( handle.isEvent() ) { (( EventFactHandle ) handle).incPendingActions(); } this.handle = handle; this.context = context; }
/** * @see WorkingMemory */ public FactHandle getFactHandleByIdentity(final Object object) { return getObjectStore().getHandleForObjectIdentity( object ); }
public void addRuleFlowGroupListener(String ruleFlowGroup, RuleFlowGroupListener listener) { InternalRuleFlowGroup rfg = (InternalRuleFlowGroup) this.getRuleFlowGroup( ruleFlowGroup ); rfg.addRuleFlowGroupListener( listener ); }
public void deactivateRuleFlowGroup(final String name) { ((InternalRuleFlowGroup) getRuleFlowGroup( name )).setActive( false ); }
/** * This class is not thread safe, changes to the working memory during * iteration may give unexpected results */ public Iterator iterateFactHandles() { return getObjectStore().iterateFactHandles(); }
public int compare(EqualityKey key1, EqualityKey key2) { return key1.getFactHandle().getId() - key2.getFactHandle().getId(); } }
/** * This class is not thread safe, changes to the working memory during * iteration may give unexpected results */ public Iterator iterateObjects(org.drools.runtime.ObjectFilter filter) { return getObjectStore().iterateObjects( filter ); }