Package org.drools.core.reteoo

Examples of org.drools.core.reteoo.MockTupleSource


        final AbstractWorkingMemory workingMemory = (AbstractWorkingMemory) ruleBase.newStatefulSession();
        final Agenda agenda = workingMemory.getAgenda();

        final Rule rule = new Rule("test-rule");
        final RuleTerminalNode node = new RuleTerminalNode(idGenerator.getNextId(),
                                                           new MockTupleSource(idGenerator.getNextId()),
                                                           rule,
                                                           rule.getLhs(),
                                                           0,
                                                           buildContext);
        final List data = new ArrayList();
View Full Code Here


        final Rule rule = new Rule("test-rule");
        final List data = new ArrayList();

        final RuleTerminalNode node = new RuleTerminalNode(idGenerator.getNextId(),
                                                           new MockTupleSource(idGenerator.getNextId()),
                                                           rule,
                                                           rule.getLhs(),
                                                           0,
                                                           buildContext);
View Full Code Here

            Class cls = null;
           
            LeftTupleSource leftTupleSource;
            if ( leftInput.startsWith( "mock" ) ) {
                leftTupleSource = new MockTupleSource( buildContext.getNextId() );               
            } else {
                leftTupleSource = (LeftTupleSource) context.get( leftInput );
            }

            ObjectSource rightObjectSource;
View Full Code Here

            String name = a[0].trim();
            String leftInput = a[1].trim();

            LeftTupleSource leftTupleSource;
            if ( "mock".equals( leftInput ) ) {
                leftTupleSource = new MockTupleSource( buildContext.getNextId() );
            } else {
                leftTupleSource = (LeftTupleSource) context.get( leftInput );
            }

            RuleImpl rule = new RuleImpl( name );
View Full Code Here

            Class cls = null;
           
            LeftTupleSource leftTupleSource;
            if ( leftInput.startsWith( "mock" ) ) {
                leftTupleSource = new MockTupleSource( buildContext.getNextId() );               
            } else {
                leftTupleSource = (LeftTupleSource) context.get( leftInput );
            }

            ObjectSource rightObjectSource;
View Full Code Here

        final Rule rule1 = new Rule("test-rule1");
        final Rule rule2 = new Rule("test-rule2");

        final RuleTerminalNode node1 = new RuleTerminalNode(3,
                                                            new MockTupleSource(2),
                                                            rule1,
                                                            rule1.getLhs(),
                                                            0,
                                                            buildContext);

        final RuleTerminalNode node2 = new RuleTerminalNode(5,
                                                            new MockTupleSource(4),
                                                            rule2,
                                                            rule2.getLhs(),
                                                            0,
                                                            buildContext);
View Full Code Here

        final InternalAgenda agenda = (InternalAgenda) workingMemory.getAgenda();

        final Rule rule1 = new Rule("test-rule1");

        final RuleTerminalNode node1 = new RuleTerminalNode(3,
                                                            new MockTupleSource(2),
                                                            rule1,
                                                            rule1.getLhs(),
                                                            0,
                                                            buildContext);
View Full Code Here

            }
        });

        final Rule rule = new Rule("test-rule");
        final RuleTerminalNode node = new RuleTerminalNode(3,
                                                           new MockTupleSource(2),
                                                           rule,
                                                           rule.getLhs(),
                                                           0,
                                                           buildContext);
View Full Code Here

        };

        // create a rule for each agendaGroup
        final Rule rule0 = new Rule("test-rule0");
        final RuleTerminalNode node0 = new RuleTerminalNode(3,
                                                            new MockTupleSource(2),
                                                            rule0,
                                                            rule0.getLhs(),
                                                            0,
                                                            buildContext);
        rule0.setConsequence(consequence);
        final PropagationContext context0 = pctxFactory.createPropagationContext(0,
                                                                                 PropagationContext.INSERTION,
                                                                                 rule0,
                                                                                 null,
                                                                                 new DefaultFactHandle());

        final Rule rule1 = new Rule("test-rule1",
                                    "agendaGroup1");
        final RuleTerminalNode node1 = new RuleTerminalNode(5,
                                                            new MockTupleSource(4),
                                                            rule1,
                                                            rule1.getLhs(),
                                                            0,
                                                            buildContext);
        rule1.setConsequence(consequence);
        final PropagationContext context1 = pctxFactory.createPropagationContext(0,
                                                                                 PropagationContext.INSERTION,
                                                                                 rule1,
                                                                                 null,
                                                                                 new DefaultFactHandle());

        final Rule rule2 = new Rule("test-rule2",
                                    "agendaGroup2");
        final RuleTerminalNode node2 = new RuleTerminalNode(7,
                                                            new MockTupleSource(6),
                                                            rule2,
                                                            rule2.getLhs(),
                                                            0,
                                                            buildContext);
        rule2.setConsequence(consequence);
        final PropagationContext context2 = pctxFactory.createPropagationContext(0,
                                                                                 PropagationContext.INSERTION,
                                                                                 rule2,
                                                                                 null,
                                                                                 new DefaultFactHandle());

        final Rule rule3 = new Rule("test-rule3",
                                    "agendaGroup3");
        final RuleTerminalNode node3 = new RuleTerminalNode(9,
                                                            new MockTupleSource(8),
                                                            rule3,
                                                            rule3.getLhs(),
                                                            0,
                                                            buildContext);
        rule3.setConsequence(consequence);
View Full Code Here

        // create a rule for the agendaGroup
        final Rule rule = new Rule("test-rule",
                                   "agendaGroup");
        final RuleTerminalNode node = new RuleTerminalNode(2,
                                                           new MockTupleSource(2),
                                                           rule,
                                                           rule.getLhs(),
                                                           0,
                                                           buildContext);
View Full Code Here

TOP

Related Classes of org.drools.core.reteoo.MockTupleSource

Copyright © 2018 www.massapicom. 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.