Package org.drools.spi

Examples of org.drools.spi.PropagationContext


        FactHandleImpl handle1 = new FactHandleImpl( 1 );
        ReteTuple tuple1 = new ReteTuple( 0,
                                          handle1,
                                          workingMemory );

        final PropagationContext context1 = new PropagationContextImpl( PropagationContext.ASSERTION,
                                                                    null,
                                                                    null );

        /* get the activation onto the agenda*/
        agenda.addToAgenda( tuple1,
                            context1,
                            rule1 );

        /* Create the second justifer */
        final Rule rule2 = new Rule( "test-rule2" );
        rule2.setConsequence( consequence );
       
        FactHandleImpl handle2 = new FactHandleImpl( 2 );
        ReteTuple tuple2 = new ReteTuple( 0,
                                          handle2,
                                          workingMemory );

        final PropagationContext context2 = new PropagationContextImpl( PropagationContext.ASSERTION,
                                                                    null,
                                                                    null );

        /* get the activations onto the agenda */
        agenda.addToAgenda( tuple2,
View Full Code Here


    }

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

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

    }

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

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

                    ((Object[]) retracted.get( 0 ))[0] );
    }
   
    public void testPropogateOnAttachRule() throws FactException
    {
        PropagationContext context = new PropagationContextImpl( PropagationContext.ASSERTION,
                                                             null,
                                                             null );

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

    }

    public void testPropagateAssertTuple() throws Exception
    {
        Rule rule = new Rule( "test-rule" );
        PropagationContext context = new PropagationContextImpl( PropagationContext.RETRACTION,
                                                             null,
                                                             null );
        WorkingMemoryImpl workingMemory = new WorkingMemoryImpl( new RuleBaseImpl( new Rete() ) );

        MockTupleSource source = new MockTupleSource( 15 );
View Full Code Here

    }

    public void testPropagateRetractTuple() throws Exception
    {
        Rule rule = new Rule( "test-rule" );
        PropagationContext context = new PropagationContextImpl( PropagationContext.RETRACTION,
                                                             null,
                                                             null );
        WorkingMemoryImpl workingMemory = new WorkingMemoryImpl( new RuleBaseImpl( new Rete() ) );

        MockTupleSource source = new MockTupleSource( 15 );
View Full Code Here

        }
    }
   
    public void testPropogateOnAttachRule() throws FactException
    {       
        PropagationContext context = new PropagationContextImpl( PropagationContext.ASSERTION,
                                                             null,
                                                             null );
        WorkingMemoryImpl workingMemory = new WorkingMemoryImpl( new RuleBaseImpl( new Rete() ) );
       
        MockTupleSource source = new MockTupleSource( 15 );
View Full Code Here

    }

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

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

    }

    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

        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

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.