PropagationContext pc = new PropagationContextImpl( propagationNumber, type, rule,
public void setShouldPropagateAll(Object node) { this.shouldPropagateAll = getPropagationAttemptsMemory().contains( node ); }
private List<String> getSettableProperties(InternalWorkingMemory workingMemory, Class<?> classType) { return getSettableProperties(workingMemory, classType, classType.getPackage().getName()); }
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 updateSinkOnAttach( BuildContext context, PropagationContext propagationContext, InternalWorkingMemory workingMemory ) { ((PropagationContextImpl)propagationContext).setEntryPoint( ( (EntryPointNode) this.source ).getEntryPoint() ); this.source.updateSink( this, propagationContext, workingMemory ); }
/** * @inheritDoc * * If an object is retract, call modify tuple for each * tuple match. */ public void retractRightTuple( final RightTuple rightTuple, final PropagationContext context, final InternalWorkingMemory workingMemory ) { final AccumulateMemory memory = (AccumulateMemory) workingMemory.getNodeMemory( this ); final InternalFactHandle origin = (InternalFactHandle) context.getFactHandleOrigin(); if ( context.getType() == PropagationContext.EXPIRATION ) { ((PropagationContextImpl) context).setFactHandle( null ); } memory.betaMemory.getRightTupleMemory().remove( rightTuple ); removePreviousMatchesForRightTuple( rightTuple, context, workingMemory, memory, rightTuple.firstChild ); if ( context.getType() == PropagationContext.EXPIRATION ) { ((PropagationContextImpl) context).setFactHandle( origin ); } }
((PropagationContextImpl) context).setModificationMask( -1L ); context.adaptModificationMaskForObjectType( objectType, workingMemory ), workingMemory ); ((PropagationContextImpl) context).setModificationMask( originalMask );
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 ); }
List<String> typeClassProps = getSettableProperties(workingMemory, classType, pkgName); List<String> modifiedClassProps = getSettableProperties( workingMemory, modifiedClass );
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,