Examples of PropagationContext


Examples of org.drools.spi.PropagationContext

    }

    public void testRetractObject() throws Exception
    {
        Rule rule = new Rule( "test-rule" );
        PropagationContext context = new PropagationContextImpl( PropagationContext.ASSERTION,
                                                             null,
                                                             null );

        WorkingMemoryImpl memory = new WorkingMemoryImpl( new RuleBaseImpl( new Rete() ) );
View Full Code Here

Examples of org.drools.spi.PropagationContext

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

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

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

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

Examples of org.drools.spi.PropagationContext

        } );

        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

Examples of org.drools.spi.PropagationContext

                                         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

Examples of org.drools.spi.PropagationContext

        /* 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

Examples of org.drools.spi.PropagationContext

    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

Examples of org.drools.spi.PropagationContext

    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

Examples of org.drools.spi.PropagationContext

                ((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

Examples of org.drools.spi.PropagationContext

                                            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
TOP
Copyright © 2018 www.massapi.com. 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.