Package org.drools.core.spi

Examples of org.drools.core.spi.Consequence


        final AgendaGroup agendaGroup = new AgendaGroupQueueImpl("agendaGroup",
                                                                 kBase);
        agenda.addAgendaGroup(agendaGroup);

        // create the consequence
        final Consequence consequence = new Consequence() {
            private static final long serialVersionUID = 510l;

            public void evaluate(KnowledgeHelper knowledgeHelper,
                                 WorkingMemory workingMemory) {
                // do nothing
View Full Code Here


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

        final List list = new ArrayList();

        // create the consequence
        final Consequence consequence = new Consequence() {
            private static final long serialVersionUID = 510l;

            public void evaluate(KnowledgeHelper knowledgeHelper,
                                 WorkingMemory workingMemory) {
                list.add(knowledgeHelper.getRule());
View Full Code Here

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

        final List list = new ArrayList();

        // create the consequence
        final Consequence consequence = new Consequence() {
            private static final long serialVersionUID = 510l;

            public void evaluate(KnowledgeHelper knowledgeHelper,
                                 WorkingMemory workingMemory) {
                list.add(knowledgeHelper.getRule());
View Full Code Here

        final StatefulKnowledgeSessionImpl ksession = (StatefulKnowledgeSessionImpl)kBase.newStatefulKnowledgeSession();

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

        // create rule1
        final Consequence consequence1 = new Consequence() {
            private static final long serialVersionUID = 510l;

            public void evaluate(KnowledgeHelper knowledgeHelper,
                                 WorkingMemory workingMemory) {
                // do nothing
            }

            public void readExternal(ObjectInput in) throws IOException,
                    ClassNotFoundException {

            }

            public void writeExternal(ObjectOutput out) throws IOException {

            }

            public String getName() {
                return "default";
            }
        };

        final RuleImpl rule1 = new RuleImpl("test-rule1");
        rule1.setAgendaGroup("rule-flow-group-0");
        rule1.setConsequence(consequence1);

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

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

        // create rule0
        final Consequence consequence0 = new

                Consequence() {
                    private static final long serialVersionUID = 510l;

                    public void evaluate(KnowledgeHelper knowledgeHelper,
View Full Code Here

        final StatefulKnowledgeSessionImpl ksession = (StatefulKnowledgeSessionImpl)kBase.newStatefulKnowledgeSession();

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

        // create rule1
        final Consequence consequence1 = new Consequence() {
            private static final long serialVersionUID = 510l;

            public void evaluate(KnowledgeHelper knowledgeHelper,
                                 WorkingMemory workingMemory) {
                // do nothing
            }

            public void readExternal(ObjectInput in) throws IOException,
                    ClassNotFoundException {

            }

            public void writeExternal(ObjectOutput out) throws IOException {

            }

            public String getName() {
                return "default";
            }
        };

        final RuleImpl rule1 = new RuleImpl("test-rule1");
        rule1.setAgendaGroup("rule-flow-group-0");
        rule1.setConsequence(consequence1);

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

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

        final RuleTerminalNodeLeftTuple tuple1 = new RuleTerminalNodeLeftTuple(new DefaultFactHandle(1,
                                                                                                     "cheese"),
                                                                               node1,
                                                                               true);

        // create rule0
        final Consequence consequence0 = new

                Consequence() {
                    private static final long serialVersionUID = 510l;

                    public void evaluate(KnowledgeHelper knowledgeHelper,
View Full Code Here

        StatefulKnowledgeSessionImpl ksession = (StatefulKnowledgeSessionImpl)kBase.newStatefulKnowledgeSession();

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

        // create rule0
        final Consequence consequence0 = new Consequence() {
            private static final long serialVersionUID = 510l;

            public void evaluate(KnowledgeHelper knowledgeHelper,
                                 WorkingMemory w) {
                // do nothing
View Full Code Here

        StatefulKnowledgeSessionImpl ksession = (StatefulKnowledgeSessionImpl)kBase.newStatefulKnowledgeSession();

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

        // create rule0
        final Consequence consequence0 = new Consequence() {
            private static final long serialVersionUID = 510l;

            public void evaluate(KnowledgeHelper knowledgeHelper,
                                 WorkingMemory w) {
                // do nothing
View Full Code Here

        StatefulKnowledgeSessionImpl ksession = (StatefulKnowledgeSessionImpl)kBase.newStatefulKnowledgeSession();

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

        // create rule0
        final Consequence consequence0 = new Consequence() {
            private static final long serialVersionUID = 510l;

            public void evaluate(KnowledgeHelper knowledgeHelper,
                                 WorkingMemory w) {
                // do nothing
View Full Code Here

        conf.setPhreakEnabled(false);
        conf.setSequential(true);
        InternalKnowledgeBase kBase = (InternalKnowledgeBase) KnowledgeBaseFactory.newKnowledgeBase(conf);

        // create the consequence
        final Consequence consequence = new Consequence() {
            private static final long serialVersionUID = 510l;

            public void evaluate(KnowledgeHelper knowledgeHelper,
                                 WorkingMemory workingMemory) {
                // do nothing
View Full Code Here

                                                           buildContext);
        StatefulKnowledgeSessionImpl ksession = (StatefulKnowledgeSessionImpl)kBase.newStatefulKnowledgeSession();

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

        final Consequence consequence = new Consequence() {
            private static final long serialVersionUID = 510l;

            public void evaluate(KnowledgeHelper knowledgeHelper,
                                 WorkingMemory workingMemory) {
                LinkedList<LogicalDependency> list = ((DefaultKnowledgeHelper) knowledgeHelper).getpreviousJustified();
View Full Code Here

TOP

Related Classes of org.drools.core.spi.Consequence

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.