Package org.drools.core.reteoo

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


        // 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,
                             ksession);

        agenda.unstageActivations();
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);
        ((InternalRuleFlowGroup) agendaGroup).setAutoDeactivate(false);
        agendaGroup.setActive(true);
        node.assertLeftTuple(tuple,
                             context,
                             ksession);
        // activation should be ignored
        assertEquals(0,
                     agendaGroup.size());
View Full Code Here

        assertEquals(0,
                     agendaGroup.size());

        // lock-on-active is now false so activation should propagate
        rule.setLockOnActive(false);
        node.assertLeftTuple(tuple,
                             context,
                             ksession);

        agenda.unstageActivations();
View Full Code Here

                     agendaGroup.size());

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

                              context1,
                              ksession);
        node2.assertLeftTuple(tuple7,
                              context2,
                              ksession);
        node3.assertLeftTuple(tuple8,
                              context3,
                              ksession);
        agenda.unstageActivations();

        // activation-group-0 should be populated again
View Full Code Here

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

        assertEquals(2,
View Full Code Here

                        // activate rule1
                        final RuleTerminalNodeLeftTuple tuple1 = new RuleTerminalNodeLeftTuple(new DefaultFactHandle(1,
                                                                                                                     "cheese"),
                                                                                               node1,
                                                                                               true);
                        node1.assertLeftTuple(tuple1,
                                              context0,
                                              ksession);
                    }

                    public void readExternal(ObjectInput in) throws IOException,
View Full Code Here

        // Create one activation for rule0 only
        final RuleTerminalNodeLeftTuple tuple0 = new RuleTerminalNodeLeftTuple(new DefaultFactHandle(1,
                                                                                                     "cheese"),
                                                                               node0,
                                                                               true);
        node0.assertLeftTuple(tuple0,
                              context0,
                              ksession);
        agenda.unstageActivations();

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

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

        node1.assertLeftTuple(tuple1,
                              context0,
View Full Code Here

        // Create two activation for this rule
        final RuleTerminalNodeLeftTuple tuple0 = new RuleTerminalNodeLeftTuple(new DefaultFactHandle(1,
                                                                                                     "cheese"),
                                                                               node0,
                                                                               true);
        node0.assertLeftTuple(tuple0,
                              context0,
                              ksession);
        final RuleTerminalNodeLeftTuple tuple1 = new RuleTerminalNodeLeftTuple(new DefaultFactHandle(1,
                                                                                                     "cheese"),
                                                                               node0,
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.