Package org.kie.internal.utils

Examples of org.kie.internal.utils.KieHelper.addContent()


                     "     then\n" +
                     "         list.add( AString + \" World\" );\n" +
                     "end\n";

        KieHelper helper = new KieHelper();
        helper.addContent( drl, ResourceType.DRL );
        KieSession ks = helper.build(  ).newKieSession();

        ArrayList list = new ArrayList();
        ks.setGlobal( "AString", "Hello" );
        ks.setGlobal( "list", list );
View Full Code Here


                     "  list.add( 'bb' ); " +
                     "end";

        List list = new ArrayList(  );
        KieHelper helper = new KieHelper();
        helper.addContent( drl, ResourceType.DRL );
        KieSession ks = helper.build(  ).newKieSession();
        ks.setGlobal( "list", list );
        ks.fireAllRules();

        assertEquals( Arrays.asList( "aa", "bb" ), list );
View Full Code Here

                "    update( $list );\n" +
                "    System.out.println(\"FIRED\");\n" +
                "end ";

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

        List<String> list = new java.util.ArrayList();
        ksession.insert(list);
View Full Code Here

                "then\n" +
                "    list.add($count);\n" +
                "end";

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

        List<Long> list = new ArrayList<Long>();
        ksession.setGlobal("list", list);
View Full Code Here

                "then\n" +
                "    list.add($count);\n" +
                "end";

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

        List<Long> list = new ArrayList<Long>();
        ksession.setGlobal("list", list);
View Full Code Here

                     "declare Test " +
                     "  field: DaysOfWeek " +
                     "end";

        KieHelper kieHelper = new KieHelper();
        kieHelper.addContent( drl, ResourceType.DRL );
        Results res = kieHelper.verify();
        assertEquals( 0, res.getMessages().size() );
    }

View Full Code Here

                "then\n"+
                "end";


        KieHelper helper = new KieHelper();
        helper.addContent( drl, ResourceType.DRL );
        KieSession ksession = helper.build( EventProcessingOption.STREAM ).newKieSession();

        assertEquals("FactCount should be 0[1]", 0, ksession.getFactCount());

        for ( int j = 0; j < 100; j++ ) {
View Full Code Here

                "then\n" +
                "end";


        KieHelper helper = new KieHelper();
        helper.addContent(drl, ResourceType.DRL);
        KieSession ksession = helper.build(EventProcessingOption.STREAM).newKieSession();

        ksession.insert(42);
        ksession.insert(new StockTick(1L, "DROOLS", 20));
        ksession.fireAllRules();
View Full Code Here

        KieSessionConfiguration sessionConfig = KnowledgeBaseFactory.newKnowledgeSessionConfiguration();
        sessionConfig.setOption( ClockTypeOption.get( ClockType.PSEUDO_CLOCK.getId() ) );


        KieHelper helper = new KieHelper();
        helper.addContent(drl, ResourceType.DRL);
        KieSession ksession = helper.build(
                EventProcessingOption.STREAM
        ).newKieSession( sessionConfig, null );

View Full Code Here

        KieSessionConfiguration sessionConfig = KnowledgeBaseFactory.newKnowledgeSessionConfiguration();
        sessionConfig.setOption( ClockTypeOption.get( ClockType.PSEUDO_CLOCK.getId() ) );


        KieHelper helper = new KieHelper();
        helper.addContent(drl, ResourceType.DRL);
        KieSession ksession = helper.build(EventProcessingOption.STREAM).newKieSession( sessionConfig, null );

        List list = new ArrayList(  );
        ksession.setGlobal( "list", list );
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.