Package org.kie.internal.utils

Examples of org.kie.internal.utils.KieHelper


                "  MyClass(value == null)\n" +
                "then " +
                "  list.add( 3 );\n" +
                "end";

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

        List list = new ArrayList();
        ksession.setGlobal("list", list);

        assertEquals(4, ksession.fireAllRules());
View Full Code Here


                "    $m : MyClass( value == $i.toString(), data == \"x\" ) @watch( !value )\n" +
                "then \n" +
                "    modify( $m ) { setValue(\"3\"), setData(\"y\") };\n" +
                "end";

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

        List<String> list = new ArrayList<String>();
        ksession.setGlobal("list", list);

        MyClass myClass = new MyClass();
View Full Code Here

                "       $p : Person( address != null ) @watch(!address) \n" +
                "    then\n" +
                "       modify($p){getAddress().setStreet(\"foo\");}\n" +
                "end";

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

        Person p = new Person();
        p.setAddress(new Address());
        ksession.insert(p);
View Full Code Here

                "then\n" +
                "  modify($b) { setA12(1), setA99(1) };\n" +
                "  list.add(1);\n" +
                "end\n";

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

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

                "then\n" +
                "  modify($b) { setA12($b.getA12()+1), setA99(1) };\n" +
                "  list.add(1);\n" +
                "end\n";

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

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

                "then\n" +
                "  modify($b) { setA12(1), setA99(1) };\n" +
                "  list.add(1);\n" +
                "end\n";

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

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

        KieServices ks = KieServices.Factory.get();

        KieSessionConfiguration conf = KnowledgeBaseFactory.newKnowledgeSessionConfiguration();
        conf.setOption(ForceEagerActivationOption.YES);

        KieSession ksession = new KieHelper()
                .setKieModuleModel(ks.newKieModuleModel()
                                     .setConfigurationProperty(LanguageLevelOption.PROPERTY_NAME,
                                                               LanguageLevelOption.DRL6_STRICT.toString()))
                .addContent(str, ResourceType.DRL)
                .build()
View Full Code Here

                "    @Watch( \"!value\" ) $m : MyClass( value < 10 )\n" +
                "then \n" +
                "    modify( $m ) { setValue( $m.getValue()+1 ) };\n" +
                "end\n";

        KieSession ksession = new KieHelper()
                .setKieModuleModel(KieServices.Factory.get().newKieModuleModel()
                                     .setConfigurationProperty(LanguageLevelOption.PROPERTY_NAME,
                                                               LanguageLevelOption.DRL6_STRICT.toString()))
                .addContent(str, ResourceType.DRL)
                .build()
View Full Code Here

                     "    $p : Person( 37, \"Mark\"; )\n" +
                     "then\n" +
                     "    names.add( $p.getName() );\n" +
                     "end\n";

        KieBase kieBase = new KieHelper()
                .setKieModuleModel(KieServices.Factory.get().newKieModuleModel()
                                                      .setConfigurationProperty(LanguageLevelOption.PROPERTY_NAME,
                                                                                LanguageLevelOption.DRL6_STRICT.toString()))
                .addContent(str, ResourceType.DRL)
                .build();
View Full Code Here

                "package " + Message.class.getPackage().getName() + "\n" +
                "@Role( Role.Type.EVENT ) @Timestamp( \"startTime\" ) @Duration( \"duration\" )\n" +
                "declare " + Message.class.getCanonicalName() + "\n" +
                "end\n";

        KieSession ksession = new KieHelper()
                .setKieModuleModel(KieServices.Factory.get().newKieModuleModel()
                                                      .setConfigurationProperty(LanguageLevelOption.PROPERTY_NAME,
                                                                                LanguageLevelOption.DRL6_STRICT.toString()))
                .addContent(str, ResourceType.DRL)
                .build()
View Full Code Here

TOP

Related Classes of org.kie.internal.utils.KieHelper

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.