Package org.kie.api.runtime

Examples of org.kie.api.runtime.KieSession.fireAllRules()


        ksession.setGlobal("list", list);

        ksession.insert(0);
        ksession.fireAllRules();
        ksession.insert(1);
        ksession.fireAllRules();

        assertEquals(1, list.size());
        assertEquals(0, (int)list.get(0));
    }
View Full Code Here


        // set the agenda groups in reverse order so that stack is preserved
        session.getAgenda().getAgendaGroup( "End" ).setFocus();
        session.getAgenda().getAgendaGroup( "Start" ).setFocus();

        int x = session.fireAllRules( 10 );
        assertEquals( 2, x );
        session.dispose();
    }

    @Test
View Full Code Here

        // set the agenda groups in reverse order so that stack is preserved
        ksession.getAgenda().getAgendaGroup( "Start" ).setFocus();
        ksession.getAgenda().getAgendaGroup( "End" ).setFocus();
        ksession.getAgenda().getAgendaGroup( "Start" ).setFocus();

        ksession.fireAllRules();

        assertEquals(2, trailerList.size());
    }

View Full Code Here

        helper.addContent( drl, ResourceType.DRL );
        KieSession ksession = helper.build().newKieSession();

        ksession.insert(new Host());
        ksession.insert("host");
        ksession.fireAllRules();
    }

    public static class TypeA {
        private int id = 1;
        public int getId() { return id; }
View Full Code Here

        ksession.insert(new TypeA());
        ksession.insert(new TypeB());
        ksession.insert(new TypeC());
        TypeD d = new TypeD();
        ksession.insert(d);
        ksession.fireAllRules();
        assertEquals(1, d.getValue());
    }

    public static class Reading {
        private final String type;
View Full Code Here

        KieSession ksession = helper.build().newKieSession();

        ksession.insert("t1");

        ksession.insert(new Reading("t1", 12));
        ksession.fireAllRules();
        ksession.insert(new Reading("t1", 0));
        ksession.fireAllRules();
        ksession.insert(new Reading("t1", 0));
        ksession.fireAllRules();
View Full Code Here

        ksession.insert("t1");

        ksession.insert(new Reading("t1", 12));
        ksession.fireAllRules();
        ksession.insert(new Reading("t1", 0));
        ksession.fireAllRules();
        ksession.insert(new Reading("t1", 0));
        ksession.fireAllRules();

        ksession.insert(new Reading("t1", 16));
        ksession.fireAllRules();
View Full Code Here

        ksession.insert(new Reading("t1", 12));
        ksession.fireAllRules();
        ksession.insert(new Reading("t1", 0));
        ksession.fireAllRules();
        ksession.insert(new Reading("t1", 0));
        ksession.fireAllRules();

        ksession.insert(new Reading("t1", 16));
        ksession.fireAllRules();
        ksession.insert(new Reading("t1", 32));
        ksession.fireAllRules();
View Full Code Here

        ksession.fireAllRules();
        ksession.insert(new Reading("t1", 0));
        ksession.fireAllRules();

        ksession.insert(new Reading("t1", 16));
        ksession.fireAllRules();
        ksession.insert(new Reading("t1", 32));
        ksession.fireAllRules();
        ksession.insert(new Reading("t1", -6));
        ksession.fireAllRules();
    }
View Full Code Here

        ksession.fireAllRules();

        ksession.insert(new Reading("t1", 16));
        ksession.fireAllRules();
        ksession.insert(new Reading("t1", 32));
        ksession.fireAllRules();
        ksession.insert(new Reading("t1", -6));
        ksession.fireAllRules();
    }

    public static class C1 {
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.