Package org.drools.core.reteoo

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


                              ksession);
        final RuleTerminalNodeLeftTuple tuple1 = new RuleTerminalNodeLeftTuple(new DefaultFactHandle(1,
                                                                                                     "cheese"),
                                                                               node0,
                                                                               true);
        node0.assertLeftTuple(tuple1,
                              context0,
                              ksession);
        agenda.unstageActivations();

        // RuleFlowGroup should be populated, but the agenda shouldn't be
View Full Code Here


        // Create an activation for this rule
        final RuleTerminalNodeLeftTuple tuple0 = new RuleTerminalNodeLeftTuple(new DefaultFactHandle(1,
                                                                                                     "cheese"),
                                                                               node0,
                                                                               true);
        node0.assertLeftTuple(tuple0,
                              context0,
                              ksession);

        ksession.fireAllRules();
View Full Code Here

        // Add another activation and activate RuleFlowGroup again
        final RuleTerminalNodeLeftTuple tuple1 = new RuleTerminalNodeLeftTuple(new DefaultFactHandle(1,
                                                                                                     "cheese"),
                                                                               node0,
                                                                               true);
        node0.assertLeftTuple(tuple1,
                              context0,
                              ksession);
        agenda.unstageActivations();
        agenda.activateRuleFlowGroup("rule-flow-group-0");
        assertEquals(1,
View Full Code Here

        // A new activation should now be added to the RuleFlowGroup but not to the agenda
        final RuleTerminalNodeLeftTuple tuple2 = new RuleTerminalNodeLeftTuple(new DefaultFactHandle(1,
                                                                                                     "cheese"),
                                                                               node0,
                                                                               true);
        node0.assertLeftTuple(tuple2,
                              context0,
                              ksession);
        agenda.unstageActivations();
        assertEquals(1,
                     ruleFlowGroup0.size());
View Full Code Here

        // When both the rule is lock-on-active and the agenda group is active, activations should be ignored
        rule.setLockOnActive(true);
        ruleFlowGroup.setAutoDeactivate(false);
        ((InternalRuleFlowGroup) ruleFlowGroup).setActive(true);
        node.assertLeftTuple(tuple1,
                             context,
                             ksession);
        // activation should be ignored
        assertEquals(0, ruleFlowGroup.size());
View Full Code Here

        // activation should be ignored
        assertEquals(0, ruleFlowGroup.size());

        // lock-on-active is now false so activation should propagate
        rule.setLockOnActive(false);
        node.assertLeftTuple(tuple2,
                             context,
                             ksession);
        agenda.unstageActivations();
        assertEquals(1,
                     ruleFlowGroup.size());
View Full Code Here

                     ruleFlowGroup.size());

        // even if lock-on-active is true, unless the agenda group is active the activation will still propagate
        rule.setLockOnActive(true);
        ((InternalAgendaGroup) ruleFlowGroup).setActive(false);
        node.assertLeftTuple(tuple3,
                             context,
                             ksession);
        agenda.unstageActivations();
        assertEquals(2,
                     ruleFlowGroup.size());
View Full Code Here

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

        // add to agendaGroup2
        node3.assertLeftTuple(tuple3_1,
                              context3,
                              workingMemory);
        agenda.unstageActivations();

        assertEquals(1,
View Full Code Here

        agenda.unstageActivations();

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

        node3.assertLeftTuple(tuple3_2,
                              context3,
                              workingMemory);
        agenda.unstageActivations();

        // agendaGroup2 now has 2 activations
View Full Code Here

                                                                                node,
                                                                                true );

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

        node.assertLeftTuple( tuple1,
                              context,
                              ksession );

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