Package org.drools.core.reteoo

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


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

                    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,
                              workingMemory);
        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,
                              workingMemory);

        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,
                              workingMemory);
        final RuleTerminalNodeLeftTuple tuple1 = new RuleTerminalNodeLeftTuple(new DefaultFactHandle(1,
                                                                                                     "cheese"),
                                                                               node0,
View Full Code Here

                              workingMemory);
        final RuleTerminalNodeLeftTuple tuple1 = new RuleTerminalNodeLeftTuple(new DefaultFactHandle(1,
                                                                                                     "cheese"),
                                                                               node0,
                                                                               true);
        node0.assertLeftTuple(tuple1,
                              context0,
                              workingMemory);
        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,
                              workingMemory);

        workingMemory.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,
                              workingMemory);
        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,
                              workingMemory);
        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,
                             workingMemory);
        // 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,
                             workingMemory);
        agenda.unstageActivations();
        assertEquals(1,
                     ruleFlowGroup.size());
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.