Package org.drools.base

Examples of org.drools.base.DefaultKnowledgeHelper.blockMatch()


       
        DefaultKnowledgeHelper kcontext = new DefaultKnowledgeHelper( wm );
        kcontext.setActivation( item1 );
       
        // set blockers
        kcontext.blockMatch( item2 );
        kcontext.blockMatch( item3 );
       
        assertNull( item1.getBlockers() );
        assertEquals( 2, item1.getBlocked().size() );
        assertEquals( 1, item2.getBlockers().size() );
View Full Code Here


        DefaultKnowledgeHelper kcontext = new DefaultKnowledgeHelper( wm );
        kcontext.setActivation( item1 );
       
        // set blockers
        kcontext.blockMatch( item2 );
        kcontext.blockMatch( item3 );
       
        assertNull( item1.getBlockers() );
        assertEquals( 2, item1.getBlocked().size() );
        assertEquals( 1, item2.getBlockers().size() );
        assertEquals( 1, item3.getBlockers().size() );
View Full Code Here

        assertEquals( 1, item2.getBlockers().size() );
        assertEquals( 1, item3.getBlockers().size() );
       
        kcontext.reset();
        kcontext.setActivation( item2 );
        kcontext.blockMatch( item3 );
        assertEquals( 2, item1.getBlocked().size() );
       
        assertEquals( 1, item2.getBlocked().size() );
        assertEquals( 1, item2.getBlockers().size() );
        assertEquals( 2, item3.getBlockers().size() );       
View Full Code Here

        // use same data structure as testAddition
        DefaultKnowledgeHelper kcontext = new DefaultKnowledgeHelper( wm );
        kcontext.setActivation( item1 );
       
        // set blockers
        kcontext.blockMatch( item2 );
        kcontext.blockMatch( item3 );
       
         // set blocked
        kcontext.reset();
        kcontext.setActivation( item2 );
View Full Code Here

        DefaultKnowledgeHelper kcontext = new DefaultKnowledgeHelper( wm );
        kcontext.setActivation( item1 );
       
        // set blockers
        kcontext.blockMatch( item2 );
        kcontext.blockMatch( item3 );
       
         // set blocked
        kcontext.reset();
        kcontext.setActivation( item2 );
        kcontext.blockMatch( item3 );
View Full Code Here

        kcontext.blockMatch( item3 );
       
         // set blocked
        kcontext.reset();
        kcontext.setActivation( item2 );
        kcontext.blockMatch( item3 );
       
        // Check all references are updated correctly when item1 is retracted
        item1.removeAllBlockersAndBlocked(agenda);
        assertEquals( 0, item2.getBlockers().size() );       
        assertEquals( 1, item2.getBlocked().size() );
View Full Code Here

         
        assertNull( item1.getBlocked() );
        assertNull( item1.getBlocked() );
       
        // reblock with item2, so that we can retract item3
        kcontext.blockMatch( item3 );
        assertNull( item2.getBlockers() );       
        assertEquals( 1, item2.getBlocked().size() );
        assertEquals(1, item3.getBlockers().size());
        assertNull(item3.getBlocked());
        assertSame( item2, ((LogicalDependency)item2.getBlocked().getFirst()).getJustifier() );
View Full Code Here

        AgendaItem item3 = agenda.createAgendaItem( null, 0, null, null );
       
        // use same data structure as testAddition
        DefaultKnowledgeHelper kcontext = new DefaultKnowledgeHelper( wm );
        kcontext.setActivation( item1 );
        kcontext.blockMatch( item3 );
       
        kcontext.reset();
        kcontext.setActivation( item2 );
        kcontext.blockMatch( item3 );
View Full Code Here

        kcontext.setActivation( item1 );
        kcontext.blockMatch( item3 );
       
        kcontext.reset();
        kcontext.setActivation( item2 );
        kcontext.blockMatch( item3 );

        kcontext.unblockAllMatches( item3 );
           
        assertEquals( 0, item3.getBlockers().size() );
        assertNull( item3.getBlocked() );
View Full Code Here

        // use same data structure as testAddition
        DefaultKnowledgeHelper kcontext = new DefaultKnowledgeHelper( wm );
        kcontext.setActivation( item1 );
       
        // set blockers
        kcontext.blockMatch( item2 );
        kcontext.blockMatch( item3 );
       
         // set blocked
        kcontext.reset();
        kcontext.setActivation( item1 );
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.