Package org.drools.core.reteoo

Examples of org.drools.core.reteoo.RuleTerminalNode.assertLeftTuple()


        // agendaGroup3, the current focus, has no activations
        assertEquals(0,
                     agenda.getFocus().size());

        // add to agendaGroup 3
        node3.assertLeftTuple(tuple4,
                              context3,
                              workingMemory);

        agenda.unstageActivations();
View Full Code Here


        agenda.unstageActivations();

        assertEquals(1,
                     agenda.getFocus().size());

        node3.assertLeftTuple(tuple5,
                              context3,
                              workingMemory);

        agenda.unstageActivations();
View Full Code Here

        // first test that autoFocus=false works. Here the rule should not fire
        // as its agendaGroup does not have focus.
        rule.setAutoFocus(false);

        node.assertLeftTuple(tuple,
                             context,
                             workingMemory);

        agenda.unstageActivations();
View Full Code Here

        // Now test that autoFocus=true works. Here the rule should fire as its
        // agendaGroup gets the focus when the activation is created.
        rule.setAutoFocus(true);

        node.assertLeftTuple(tuple,
                             context,
                             workingMemory);

        agenda.unstageActivations();
View Full Code Here

                                                                                true );

        final PropagationContext context1 = pctxFactory.createPropagationContext(0, PropagationContext.INSERTION, null, null, new DefaultFactHandle());

        // Test single activation for a single logical assertions
        node.assertLeftTuple( tuple1,
                              context1,
                              workingMemory );

        final String logicalString = new String( "logical" );
        InternalFactHandle logicalHandle = (InternalFactHandle) workingMemory.insert( logicalString,
View Full Code Here

                    ((RightTuple) values[0]).getFactHandle() );

        // Test single activation for a single logical assertions. This also
        // tests that logical assertions live on after the related Activation
        // has fired.
        node.assertLeftTuple( tuple1,
                              context1,
                              workingMemory );
        logicalHandle = (InternalFactHandle) workingMemory.insert( logicalString,
                                                                   null,
                                                                   false,
View Full Code Here

                                                                                true );

        final PropagationContext context1 = pctxFactory.createPropagationContext(0, PropagationContext.INSERTION, null, null, new DefaultFactHandle());

        // Test single activation for a single logical assertions
        node.assertLeftTuple( tuple1,
                              context1,
                              workingMemory );

        final String logicalString1 = new String( "logical" );
        FactHandle logicalHandle1 = workingMemory.insert( logicalString1,
View Full Code Here

                                                                                true );

        final PropagationContext context1 = pctxFactory.createPropagationContext(0, PropagationContext.INSERTION, null, null, new DefaultFactHandle());

        // Test that a STATED assertion overrides a logical assertion
        node.assertLeftTuple( tuple1,
                              context1,
                              workingMemory );

        String logicalString1 = new String( "logical" );
        FactHandle logicalHandle1 = workingMemory.insert( logicalString1,
View Full Code Here

        // they are not identity same
        assertNotSame( logicalString1,
                       workingMemory.getObject( logicalHandle2 ) );

        // Test that a logical assertion cannot override a STATED assertion
        node.assertLeftTuple( tuple1,
                              context1,
                              workingMemory );

        logicalString2 = new String( "logical" );
        logicalHandle2 = workingMemory.insert( logicalString2 );
View Full Code Here

                                                                                node,
                                                                                true );

        final PropagationContext context = pctxFactory.createPropagationContext(0, PropagationContext.INSERTION, null, null, new DefaultFactHandle());

        node.assertLeftTuple( tuple1,
                              context,
                              workingMemory );

        // Assert the logical "logical" fact
        final String logicalString1 = new String( "logical" );
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.