Package org.kie.builder

Examples of org.kie.builder.KieModuleModel


    }

    private InternalKieModule createKieJarWithClass(KieServices ks, ReleaseId releaseId, int value, int factor) throws IOException {
        KieFileSystem kieFileSystem = ks.newKieFileSystem();

        KieModuleModel kproj = ks.newKieModuleModel();

        KieBaseModel kieBaseModel1 = kproj.newKieBaseModel("KBase1")
                .setEqualsBehavior( EqualityBehaviorOption.EQUALITY )
                .setEventProcessingMode( EventProcessingOption.STREAM );

        KieSessionModel ksession1 = kieBaseModel1.newKieSessionModel("KSession1")
                .setType(KieSessionType.STATEFUL)
                .setClockType( ClockTypeOption.get("realtime") );

        kieFileSystem
                .writeKModuleXML(kproj.toXML())
                .writePomXML(getPom(releaseId))
                .write("src/main/resources/" + kieBaseModel1.getName() + "/rule1.drl", createDRLForJavaSource(value))
                .write("src/main/java/org/kie/test/Bean.java", createJavaSource(factor));

        KieBuilder kieBuilder = ks.newKieBuilder(kieFileSystem);
View Full Code Here


        for (String rule : rules) {
            String file = "org/test/" + rule + ".drl";
            kfs.write("src/main/resources/KBase1/" + file, createDRL(rule));
        }

        KieModuleModel kproj = ks.newKieModuleModel();

        KieBaseModel kieBaseModel1 = kproj.newKieBaseModel("KBase1")
                .setEqualsBehavior( EqualityBehaviorOption.EQUALITY )
                .setEventProcessingMode( EventProcessingOption.STREAM );

        KieSessionModel ksession1 = kieBaseModel1.newKieSessionModel("KSession1")
                .setType(KieSessionType.STATEFUL)
                .setClockType( ClockTypeOption.get("realtime") );

        kfs.writeKModuleXML(kproj.toXML());
        kfs.writePomXML( getPom(releaseId) );

        KieBuilder kieBuilder = ks.newKieBuilder(kfs);
        assertTrue(kieBuilder.buildAll().getResults().getMessages().isEmpty());
        return ( InternalKieModule ) kieBuilder.getKieModule();
View Full Code Here

        while ( e.hasMoreElements() ) {
            URL url = e.nextElement();
            try {
                String fixedURL = fixURLFromKProjectPath( url );
                InternalKieModule kModule = fetchKModule( url, fixedURL );
                KieModuleModel kModuleModel = kModule.getKieModuleModel();
               
                kModules.add( kModuleModel );
                urls.put( kModuleModel,
                          fixedURL );
View Full Code Here

    public static InternalKieModule fetchKModule(URL url) {
        return fetchKModule(url, fixURLFromKProjectPath(url));
    }
   
    public static InternalKieModule fetchKModule(URL url, String fixedURL) {
        KieModuleModel kieProject = KieModuleModelImpl.fromXML( url );

        String pomProperties = getPomProperties( fixedURL );
       
        GAV gav = GAVImpl.fromPropertiesString( pomProperties );
View Full Code Here

    public static void indexParts(Map<GAV, InternalKieModule> kJars,
                                  Map<String, KieBaseModel> kBaseModels,
                                  Map<String, KieSessionModel> kSessionModels,
                                  Map<String, InternalKieModule> kJarFromKBaseName) {
        for ( InternalKieModule kJar : kJars.values() ) {
            KieModuleModel kieProject = kJar.getKieModuleModel();
            for ( KieBaseModel kieBaseModel : kieProject.getKieBaseModels().values() ) {
                kBaseModels.put( kieBaseModel.getName(),
                                 kieBaseModel );
                ((KieBaseModelImpl) kieBaseModel).setKModule( kieProject ); // should already be set, but just in case

                kJarFromKBaseName.put( kieBaseModel.getName(),
View Full Code Here

    public static InternalKieModule fetchKModule(URL url) {
        return fetchKModule(url, fixURLFromKProjectPath(url));
    }
   
    public static InternalKieModule fetchKModule(URL url, String fixedURL) {
        KieModuleModel kieProject = KieModuleModelImpl.fromXML( url );
        setDefaultsforEmptyKieModule(kieProject);

        String pomProperties = getPomProperties( fixedURL );
       
        ReleaseId releaseId = ReleaseIdImpl.fromPropertiesString(pomProperties);
View Full Code Here

    }

    protected void indexParts(Map<ReleaseId, InternalKieModule> kieModules,
                              Map<String, InternalKieModule> kJarFromKBaseName) {
        for ( InternalKieModule kJar : kieModules.values() ) {
            KieModuleModel kieProject = kJar.getKieModuleModel();
            for ( KieBaseModel kieBaseModel : kieProject.getKieBaseModels().values() ) {
                if (kieBaseModel.isDefault()) {
                    if (defaultKieBase == null) {
                        defaultKieBase = kieBaseModel;
                    } else {
                        defaultKieBase = null;
View Full Code Here

    public static InternalKieModule fetchKModule(URL url) {
        return fetchKModule(url, fixURLFromKProjectPath(url));
    }
   
    public static InternalKieModule fetchKModule(URL url, String fixedURL) {
        KieModuleModel kieProject = KieModuleModelImpl.fromXML( url );

        setDefaultsforEmptyKieModule(kieProject);

        String pomProperties = getPomProperties( fixedURL );
       
View Full Code Here

TOP

Related Classes of org.kie.builder.KieModuleModel

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.