PropagationContext pc = new PropagationContextImpl( propagationNumber, type, rule,
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 ); }
public void execute(InternalWorkingMemory workingMemory) { final PropagationContext context = new PropagationContextImpl( workingMemory.getNextPropagationIdCounter(), PropagationContext.ASSERTION, this.ruleOrigin, this.leftTuple, this.factHandle ); ReteooRuleBase ruleBase = (ReteooRuleBase) workingMemory.getRuleBase(); ruleBase.assertObject( this.factHandle, this.factHandle.getObject(), context, workingMemory ); context.evaluateActionQueue( workingMemory ); }
private void updatePropagations( BaseNode baseTerminalNode, BuildContext context ) { baseTerminalNode.networkUpdated( new UpdateContext() ); for ( InternalWorkingMemory workingMemory : context.getWorkingMemories() ) { final PropagationContext propagationContext = new PropagationContextImpl(workingMemory.getNextPropagationIdCounter(), PropagationContext.RULE_ADDITION, null, null, null); for ( BaseNode node : context.getNodes() ) { node.updateSinkOnAttach( context, propagationContext, workingMemory ); } propagationContext.evaluateActionQueue( workingMemory ); } }
if( handle.isValid() ) { final PropagationContext propagationContext = new PropagationContextImpl( workingMemory.getNextPropagationIdCounter(), PropagationContext.EXPIRATION, null,
public void closeLiveQuery(final InternalFactHandle factHandle) { try { startOperation(); this.ruleBase.readLock(); this.lock.lock(); final PropagationContext propagationContext = new PropagationContextImpl( getNextPropagationIdCounter(), PropagationContext.ASSERTION, null, null, factHandle, agenda.getActiveActivations(), agenda.getDormantActivations(), getEntryPoint() ); getEntryPointNode().retractQuery( factHandle, propagationContext, this ); propagationContext.evaluateActionQueue( this ); getFactHandleFactory().destroyFactHandle( factHandle ); } finally { this.lock.unlock(); this.ruleBase.readUnlock(); endOperation(); } }
public void build(BuildContext context, BuildUtils utils, RuleConditionElement rce) { NamedConsequence namedConsequence = (NamedConsequence) rce; RuleTerminalNode terminalNode = buildTerminalNodeForNamedConsequence(context, namedConsequence); terminalNode.attach(context); terminalNode.networkUpdated(new UpdateContext()); // adds the terminal node to the list of nodes created/added by this sub-rule context.addNode(terminalNode); for ( InternalWorkingMemory workingMemory : context.getWorkingMemories() ) { final PropagationContext propagationContext = new PropagationContextImpl(workingMemory.getNextPropagationIdCounter(), PropagationContext.RULE_ADDITION, null, null, null); for ( BaseNode node : context.getNodes() ) { node.updateSinkOnAttach( context, propagationContext, workingMemory ); } propagationContext.evaluateActionQueue( workingMemory ); } }
final PropagationContext propagationContext = new PropagationContextImpl( workingMemory.getNextPropagationIdCounter(), PropagationContext.EXPIRATION, null,
this ); final PropagationContext propagationContext = new PropagationContextImpl( getNextPropagationIdCounter(), PropagationContext.ASSERTION, null,
this ); final PropagationContext propagationContext = new PropagationContextImpl( getNextPropagationIdCounter(), PropagationContext.ASSERTION, null,
public void execute(InternalWorkingMemory workingMemory) { if ( this.factHandle.isValid() ) { EventFactHandle eventHandle = (EventFactHandle) factHandle; if ( eventHandle.hasPendingActions() ) { workingMemory.queueWorkingMemoryAction( this ); return; } // if the fact is still in the working memory (since it may have been previously retracted already final PropagationContext context = new PropagationContextImpl( workingMemory.getNextPropagationIdCounter(), PropagationContext.EXPIRATION, null, null, this.factHandle ); eventHandle.setExpired( true ); this.node.retractObject( factHandle, context, workingMemory ); context.evaluateActionQueue( workingMemory ); // if no activations for this expired event if ( eventHandle.getActivationsCount() == 0 ) { // remove it from the object store and clean up resources eventHandle.getEntryPoint().retract( factHandle ); } context.evaluateActionQueue( workingMemory ); } }
public void initInitialFact( InternalRuleBase ruleBase, MarshallerReaderContext context ) { ruleBase.lock(); Object initialFact = InitialFactImpl.getInstance(); ObjectTypeConf otc = this.defaultEntryPoint.getObjectTypeConfigurationRegistry() .getObjectTypeConf( this.defaultEntryPoint.entryPoint, initialFact ); this.initialFactHandle = ruleBase.getConfiguration().getComponentFactory().getFactHandleFactoryService().newFactHandle( 0, initialFact, 0, otc, this, this.defaultEntryPoint ); final PropagationContext pctx = new PropagationContextImpl( 0, PropagationContext.ASSERTION, null, null , initialFactHandle, 0, 0, defaultEntryPoint.getEntryPoint(), context ); otc.getConcreteObjectTypeNode().assertObject( this.initialFactHandle, pctx, this ); // ADDED, NOT IN THE ORIGINAL 6.x COMMIT pctx.evaluateActionQueue( this ); ruleBase.unlock(); }
final PropagationContext propagationContext = new PropagationContextImpl( this.wm.getNextPropagationIdCounter(), PropagationContext.RETRACTION, rule,
final PropagationContext propagationContext = new PropagationContextImpl( this.wm.getNextPropagationIdCounter(), PropagationContext.ASSERTION, rule,
private static void assertHandleIntoOTN(MarshallerReaderContext context, InternalWorkingMemory wm, InternalFactHandle handle) { Object object = handle.getObject(); InternalWorkingMemoryEntryPoint ep = (InternalWorkingMemoryEntryPoint) handle.getEntryPoint(); ObjectTypeConf typeConf = ((InternalWorkingMemoryEntryPoint) handle.getEntryPoint()).getObjectTypeConfigurationRegistry().getObjectTypeConf( ep.getEntryPoint(), object ); PropagationContextImpl propagationContext = new PropagationContextImpl( wm.getNextPropagationIdCounter(), PropagationContext.ASSERTION, null, null, handle, ((DefaultAgenda) wm.getAgenda()).getActiveActivations(), ((DefaultAgenda) wm.getAgenda()).getDormantActivations(), ep.getEntryPoint(), context); ep.getEntryPointNode().assertObject( handle, propagationContext, typeConf, wm ); propagationContext.evaluateActionQueue( wm ); wm.executeQueuedActions(); propagationContext.cleanReaderContext(); }
public void cleanUp(final LeftTuple leftTuple, final InternalWorkingMemory workingMemory) { if ( leftTuple.getLeftTupleSink() != node ) { return; } final Activation activation = (Activation) leftTuple.getObject(); // this is to catch a race condition as activations are activated and unactivated on timers if ( activation instanceof ScheduledAgendaItem ) { ScheduledAgendaItem scheduled = (ScheduledAgendaItem) activation; workingMemory.getTimerService().removeJob( scheduled.getJobHandle() ); scheduled.getJobHandle().setCancel( true ); } if ( activation.isActivated() ) { activation.remove(); ((EventSupport) workingMemory).getAgendaEventSupport().fireActivationCancelled( activation, workingMemory, ActivationCancelledCause.CLEAR ); } final PropagationContext propagationContext = new PropagationContextImpl( workingMemory.getNextPropagationIdCounter(), PropagationContext.RULE_REMOVAL, null, null, null ); workingMemory.getTruthMaintenanceSystem().removeLogicalDependencies( activation, propagationContext, node.getRule() ); leftTuple.unlinkFromLeftParent(); leftTuple.unlinkFromRightParent(); } }
final PropagationContext propagationContext = new PropagationContextImpl( this.wm.getNextPropagationIdCounter(), PropagationContext.MODIFICATION, rule,
PropagationContext cancelContext = new PropagationContextImpl( workingMemory.getNextPropagationIdCounter(), org.drools.runtime.rule.PropagationContext.RETRACTION,