Package org.kie.api.builder

Examples of org.kie.api.builder.ReleaseId


                "end\n";

        KieServices ks = KieServices.Factory.get();

        // Create an in-memory jar for version 1.0.0
        ReleaseId releaseId = ks.newReleaseId("org.kie", "test-upgrade", "1.0.0");
        byte[] jar = createKJar(ks, releaseId, null, drl1);
        KieModule km = deployJar(ks, jar);

        // Create a session and fire rules
        KieContainer kc = ks.newKieContainer(km.getReleaseId());
View Full Code Here


                "end\n";

        KieServices ks = KieServices.Factory.get();

        // Create an in-memory jar for version 1.0.0
        ReleaseId releaseId = ks.newReleaseId("org.kie", "test-upgrade", "1.0.0");
        byte[] jar = createKJar(ks, releaseId, null, drl1);
        KieModule km = deployJar(ks, jar);

        // Create a session and fire rules
        KieContainer kc = ks.newKieContainer(km.getReleaseId());
View Full Code Here

        return "META-INF/maven/" + groupId + "/" + artifactId + "/";
    }
   
    public static ReleaseId fromPropertiesString(String string) {
        Properties props = new Properties();
        ReleaseId releaseId = null;
        try {
            props.load( new StringReader( string ) );
            String groupId = props.getProperty( "groupId" );
            String artifactId = props.getProperty( "artifactId" );
            String version = props.getProperty( "version" );           
View Full Code Here

                                "maven pom.xml found, but unable to read\n" + e.getMessage() );
        }
    }

    public static void validatePomModel(PomModel pomModel) {
        ReleaseId pomReleaseId = pomModel.getReleaseId();
        if ( StringUtils.isEmpty( pomReleaseId.getGroupId() ) || StringUtils.isEmpty( pomReleaseId.getArtifactId() ) || StringUtils.isEmpty( pomReleaseId.getVersion() ) ) {
            throw new RuntimeException( "Maven pom.properties exists but ReleaseId content is malformed" );
        }
    }
View Full Code Here

            URL url = e.nextElement();
            System.out.println( "kmodules: " + url);
            try {
                InternalKieModule kModule = fetchKModule(url);

                ReleaseId releaseId = kModule.getReleaseId();
                kieModules.put(releaseId, kModule);

                log.debug( "Discovered classpath module " + releaseId.toExternalForm() );
               
                kr.addKieModule(kModule);

            } catch ( Exception exc ) {
                log.error( "Unable to build index of kmodule.xml url=" + url.toExternalForm() + "\n" + exc.getMessage() );
View Full Code Here

        setDefaultsforEmptyKieModule(kieProject);

        String pomProperties = getPomProperties( fixedURL );
       
        ReleaseId releaseId = ReleaseIdImpl.fromPropertiesString(pomProperties);

        String rootPath = fixedURL;
        if ( rootPath.lastIndexOf( ':' ) > 0 ) {
            rootPath = fixedURL.substring( rootPath.lastIndexOf( ':' ) + 1 );
        }
View Full Code Here

                byte[] bytes = mfs.getBytes( KieModuleModelImpl.KMODULE_JAR_PATH );
                KieModuleModel kieProject = KieModuleModelImpl.fromXML( new ByteArrayInputStream( bytes ) );
                setDefaultsforEmptyKieModule(kieProject);

                String pomProperties = mfs.findPomProperties();
                ReleaseId releaseId = ReleaseIdImpl.fromPropertiesString(pomProperties);
                kModule = new MemoryKieModule( releaseId, kieProject, mfs );
            }
            return kModule;
        } catch ( Exception e ) {
            throw new RuntimeException("Unable to fetch module from resource :" + res, e);
View Full Code Here

    private static class KieModuleRepo {
        private final Map<String, TreeMap<ComparableVersion, KieModule>> kieModules = new HashMap<String, TreeMap<ComparableVersion, KieModule>>();

        void store(KieModule kieModule) {
            ReleaseId releaseId = kieModule.getReleaseId();
            String ga = releaseId.getGroupId() + ":" + releaseId.getArtifactId();

            TreeMap<ComparableVersion, KieModule> artifactMap = kieModules.get(ga);
            if (artifactMap == null) {
                artifactMap = new TreeMap<ComparableVersion, KieModule>();
                kieModules.put(ga, artifactMap);
            }
            artifactMap.put(new ComparableVersion(releaseId.getVersion()), kieModule);
        }
View Full Code Here

        List<SimulationPath> paths = finder.findPaths(new SimulationFilterPathFormatConverter(provider));
       
        // TODO when introduced configurable start time that should be used instead of currentTimeMillis
        context.getRepository().setSimulationInfo(new SimulationInfo(System.currentTimeMillis(), processId, numberOfAllInstances, interval));
       
        ReleaseId releaseId = createKJarWithMultipleResources("TestKbase",
                new String[]{bpmn2Container}, new ResourceType[]{ResourceType.BPMN2});
       
        SimulationFluent f = new DefaultSimulationFluent();
        // @formatter:off       
        int counter = 0;
View Full Code Here

        KieServices ks = KieServices.Factory.get();

        KieFileSystem kfs = ks.newKieFileSystem().write( "src/main/resources/r1.drl", drl );
        ks.newKieBuilder( kfs ).buildAll();
       
        ReleaseId releaseId = ks.getRepository().getDefaultReleaseId();
        InternalKieModule kieModule = (InternalKieModule) ks.getRepository().getKieModule( releaseId );
        byte[] jar = kieModule.getBytes();
       
        MemoryFileSystem mfs = MemoryFileSystem.readFromJar( jar );
        File file = mfs.getFile( KieBuilderImpl.getCompilationCachePath( releaseId, "KBase1") );
View Full Code Here

TOP

Related Classes of org.kie.api.builder.ReleaseId

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.