Package org.kie.api.builder

Examples of org.kie.api.builder.KieBuilder.buildAll()


                  kfs.writeKModuleXML(new String( Util.getResourceContentsAsCharArray( (IFile)resource ) ));
                }
          }
         
          KieBuilder kieBuilder = ks.newKieBuilder(kfs);
          List<Message> messages = kieBuilder.buildAll().getResults().getMessages();
          for (Message message : messages) {
            IResource resource = resourcesMap.get(message.getPath());
            if (resource == null) {
              resource = resourcesMap.get("src/main/resources/" + message.getPath());
            }
View Full Code Here


        kfs.write( ResourceFactory.newClassPathResource( source1 ).setResourceType( ResourceType.PMML ) );
        kfs.write( ResourceFactory.newClassPathResource( source2 ).setResourceType( ResourceType.PMML ) );

        KieBuilder kb = ks.newKieBuilder( kfs );
        kb.buildAll();

        KieSession kSession = ks.newKieContainer( ks.getRepository().getDefaultReleaseId() ).newKieSession();

        kSession.fireAllRules();
View Full Code Here

        KieFileSystem kfs = ks.newKieFileSystem();
        KieBuilder kb = ks.newKieBuilder( kfs );

        kfs.generateAndWritePomXML( releaseId1 );
        kfs.write( ResourceFactory.newClassPathResource( source1 ).setResourceType( ResourceType.PMML ) );
        kb.buildAll();

        KieContainer kc = ks.newKieContainer( releaseId1 );
        KieSession kSession = kc.newKieSession();
        kSession.fireAllRules();
View Full Code Here

                           .setResourceType( ResourceType.PMML )
                           .setSourcePath( "pmlm.pmml" )
        );

        KieBuilder kb = ks.newKieBuilder( kfs );
        kb.buildAll();
        assertEquals( 1, kb.getResults().getMessages( Message.Level.ERROR ).size() );
    }

    @Test
    public void testNoErrorDuringGeneration() {
View Full Code Here

                           .setResourceType( ResourceType.PMML )
                           .setSourcePath( "pmml.pmml" )
        );

        KieBuilder kb = ks.newKieBuilder( kfs );
        kb.buildAll();
        assertEquals( 0, kb.getResults().getMessages( Message.Level.ERROR ).size() );
    }


}
View Full Code Here

        kfs.writeKModuleXML( model.toXML() );

        KieBuilder kb = ks.newKieBuilder( kfs );

        kb.buildAll();
        if ( kb.getResults().hasMessages( Message.Level.ERROR ) ) {
            throw new RuntimeException( "Build Errors:\n" + kb.getResults().toString() );
        }

        KieContainer kContainer = ks.newKieContainer( kr.getDefaultReleaseId() );
View Full Code Here

        kfs.writeKModuleXML( model.toXML() );

        KieBuilder kb = ks.newKieBuilder( kfs );

        kb.buildAll();
        if ( kb.getResults().hasMessages( Message.Level.ERROR ) ) {
            throw new RuntimeException( "Build Errors:\n" + kb.getResults().toString() );
        }

        KieContainer kContainer = ks.newKieContainer( kr.getDefaultReleaseId() );
View Full Code Here

        kfs.writeKModuleXML(kModuleModel.toXML());
        kfs.write("src/main/resources/kiemodulemodel/HAL6.drl", getRule());

        KieBuilder kb = ks.newKieBuilder(kfs);
        kb.setDependencies(ex1Res, ex2Res);
        kb.buildAll(); // kieModule is automatically deployed to KieRepository if successfully built.
        if (kb.getResults().hasMessages(Level.ERROR)) {
            throw new RuntimeException("Build Errors:\n" + kb.getResults().toString());
        }

        KieContainer kContainer = ks.newKieContainer(rid);
View Full Code Here

        KieServices ks = KieServices.Factory.get();
        KieFileSystem kfs = ks.newKieFileSystem();
        kfs.write(ResourceFactory.newByteArrayResource(str.getBytes()).setTargetPath("org/drools/compiler/rules.drl") );
       
        KieBuilder kbuilder = KieServices.Factory.get().newKieBuilder(kfs);
        kbuilder.buildAll();
       
        assertEquals(0, kbuilder.getResults().getMessages().size());

        ks.newKieContainer(kbuilder.getKieModule().getReleaseId()).getKieBase();
        KieSession ksession = ks.newKieContainer(kbuilder.getKieModule().getReleaseId()).newKieSession();
View Full Code Here

        kfs.write("src/main/resources/isA.drl", str);

        KieBuilder kbuilder = ks.newKieBuilder(kfs);

        kbuilder.buildAll();
        assertEquals(0, kbuilder.getResults().getMessages().size());

        ks.newKieContainer(kbuilder.getKieModule().getReleaseId()).getKieBase();

        KieSession ksession = ks.newKieContainer(kbuilder.getKieModule().getReleaseId()).newKieSession();
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.