Package org.drools.spi

Examples of org.drools.spi.PropagationContext


        ReteTuple tuple = new ReteTuple( 0,
                                         new FactHandleImpl( 1 ),
                                         workingMemory );

        final PropagationContext context1 = new PropagationContextImpl( PropagationContext.ASSERTION,
                                                                    rule1,
                                                                    new AgendaItem( tuple,
                                                                                    initContext,
                                                                                    rule1 ) );
View Full Code Here


        } );

        ReteTuple tuple = new ReteTuple( 0,
                                         new FactHandleImpl( 1 ),
                                         workingMemory );
        final PropagationContext context = new PropagationContextImpl( PropagationContext.ASSERTION,
                                                                   rule,
                                                                   new AgendaItem( tuple,
                                                                                   initContext,
                                                                                   rule ) );
View Full Code Here

                                         workingMemory );

        /* create a rule for each module */
        Rule rule0 = new Rule( "test-rule0" );
        rule0.setConsequence( consequence );
        PropagationContext context0 = new PropagationContextImpl( PropagationContext.ASSERTION,
                                                              rule0,
                                                              new AgendaItem( tuple,
                                                                              initContext,
                                                                              rule0 ) );

        Rule rule1 = new Rule( "test-rule1",
                               "module1" );
        rule1.setConsequence( consequence );
        PropagationContext context1 = new PropagationContextImpl( PropagationContext.ASSERTION,
                                                              rule1,
                                                              new AgendaItem( tuple,
                                                                              initContext,
                                                                              rule0 ) );

        Rule rule2 = new Rule( "test-rule2",
                               "module2" );
        rule2.setConsequence( consequence );
        PropagationContext context2 = new PropagationContextImpl( PropagationContext.ASSERTION,
                                                              rule2,
                                                              new AgendaItem( tuple,
                                                                              initContext,
                                                                              rule0 ) );

        Rule rule3 = new Rule( "test-rule3",
                               "module3" );
        rule3.setConsequence( consequence );
        PropagationContext context3 = new PropagationContextImpl( PropagationContext.ASSERTION,
                                                              rule3,
                                                              new AgendaItem( tuple,
                                                                              initContext,
                                                                              rule0 ) );

View Full Code Here

        /* create a rule for the module */
        Rule rule = new Rule( "test-rule",
                              "module" );
        rule.setConsequence( consequence );
        PropagationContext context = new PropagationContextImpl( PropagationContext.ASSERTION,
                                                                  rule,
                                                                  new AgendaItem( tuple,
                                                                                  initContext,
                                                                                  rule   ) );
         
View Full Code Here

    public void attach(final InternalWorkingMemory[] workingMemories) {
        attach();

        for ( int i = 0, length = workingMemories.length; i < length; i++ ) {
            final InternalWorkingMemory workingMemory = workingMemories[i];
            final PropagationContext propagationContext = new PropagationContextImpl( workingMemory.getNextPropagationIdCounter(),
                                                                                      PropagationContext.RULE_ADDITION,
                                                                                      null,
                                                                                      null,
                                                                                      null);
View Full Code Here

    public void attach(final InternalWorkingMemory[] workingMemories) {
        attach();

        for ( int i = 0, length = workingMemories.length; i < length; i++ ) {
            final InternalWorkingMemory workingMemory = workingMemories[i];
            final PropagationContext propagationContext = new PropagationContextImpl( workingMemory.getNextPropagationIdCounter(),
                                                                                      PropagationContext.RULE_ADDITION,
                                                                                      null,
                                                                                      null,
                                                                                      null );
            this.tupleSource.updateSink( this,
View Full Code Here

                ((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,
View Full Code Here

                                            InternalFactHandle handle) {
        Object object = handle.getObject();
        InternalWorkingMemoryEntryPoint ep = (InternalWorkingMemoryEntryPoint) handle.getEntryPoint();
        ObjectTypeConf typeConf = ((InternalWorkingMemoryEntryPoint) handle.getEntryPoint()).getObjectTypeConfigurationRegistry().getObjectTypeConf( ep.getEntryPoint(),
                                                                                                                                                     object );
        final PropagationContext 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();
    }
View Full Code Here

            for( ProtobufMessages.Activation _activation : _justification.getActivationList() ) {
                Activation activation = (Activation) context.filter.getTuplesCache().get(
                              PersisterHelper.createActivationKey( _activation.getPackageName(),
                                                                   _activation.getRuleName(),
                                                                   _activation.getTuple() ) ).getObject();
                PropagationContext pc = activation.getPropagationContext();
                tms.addLogicalDependency( handle,
                                          activation,
                                          pc,
                                          activation.getRule() );
            }
View Full Code Here

        Package pkg = ruleBase.getPackage( pkgName );
        Rule rule = pkg.getRule( ruleName );

        RuleTerminalNode ruleTerminalNode = (RuleTerminalNode) leftTuple.getLeftTupleSink();

        PropagationContext pc = context.propagationContexts.get( stream.readLong() );

        AgendaItem activation;

        boolean scheduled = false;
        if (rule.getTimer() != null) {
View Full Code Here

TOP

Related Classes of org.drools.spi.PropagationContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.