Search in sources :

Example 56 with KieMavenRepository

use of org.kie.scanner.KieMavenRepository in project jbpm by kiegroup.

the class AsyncExecutionProcessServiceEJBIntegrationTest method deployKjar.

protected static void deployKjar() {
    KieServices ks = KieServices.Factory.get();
    ReleaseId releaseId = ks.newReleaseId(GROUP_ID, ARTIFACT_ID, VERSION);
    List<String> processes = new ArrayList<String>();
    processes.add("processes/async-execution.bpmn2");
    InternalKieModule kJar1 = createKieJar(ks, releaseId, processes);
    File pom = new File("target/kmodule", "pom.xml");
    pom.getParentFile().mkdir();
    try {
        FileOutputStream fs = new FileOutputStream(pom);
        fs.write(getPom(releaseId).getBytes());
        fs.close();
    } catch (Exception e) {
    }
    KieMavenRepository repository = getKieMavenRepository();
    repository.installArtifact(releaseId, kJar1, pom);
}
Also used : FileOutputStream(java.io.FileOutputStream) ArrayList(java.util.ArrayList) KieMavenRepository.getKieMavenRepository(org.kie.scanner.KieMavenRepository.getKieMavenRepository) KieMavenRepository(org.kie.scanner.KieMavenRepository) KieServices(org.kie.api.KieServices) ReleaseId(org.kie.api.builder.ReleaseId) File(java.io.File) InternalKieModule(org.drools.compiler.kie.builder.impl.InternalKieModule)

Example 57 with KieMavenRepository

use of org.kie.scanner.KieMavenRepository in project jbpm by kiegroup.

the class DefinitionServiceEJBIntegrationTest method deployKjar.

protected static void deployKjar() {
    KieServices ks = KieServices.Factory.get();
    ReleaseId releaseId = ks.newReleaseId(GROUP_ID, ARTIFACT_ID, VERSION);
    List<String> processes = new ArrayList<String>();
    processes.add("processes/hiring.bpmn2");
    processes.add("processes/customtask.bpmn");
    processes.add("processes/humanTask.bpmn");
    processes.add("processes/signal.bpmn");
    processes.add("processes/import.bpmn");
    processes.add("processes/callactivity.bpmn");
    processes.add("processes/itemrefissue.bpmn");
    InternalKieModule kJar1 = createKieJar(ks, releaseId, processes);
    File pom = new File("target/kmodule", "pom.xml");
    pom.getParentFile().mkdir();
    try {
        FileOutputStream fs = new FileOutputStream(pom);
        fs.write(getPom(releaseId).getBytes());
        fs.close();
    } catch (Exception e) {
    }
    KieMavenRepository repository = getKieMavenRepository();
    repository.installArtifact(releaseId, kJar1, pom);
}
Also used : FileOutputStream(java.io.FileOutputStream) ArrayList(java.util.ArrayList) KieMavenRepository.getKieMavenRepository(org.kie.scanner.KieMavenRepository.getKieMavenRepository) KieMavenRepository(org.kie.scanner.KieMavenRepository) KieServices(org.kie.api.KieServices) ReleaseId(org.kie.api.builder.ReleaseId) File(java.io.File) IOException(java.io.IOException) InternalKieModule(org.drools.compiler.kie.builder.impl.InternalKieModule)

Example 58 with KieMavenRepository

use of org.kie.scanner.KieMavenRepository in project jbpm by kiegroup.

the class MultipleDeploymentsProcessServiceEJBIntegrationTest method deployKjar.

protected static void deployKjar() {
    KieServices ks = KieServices.Factory.get();
    ReleaseId releaseId = ks.newReleaseId(GROUP_ID, ARTIFACT_ID, VERSION);
    List<String> processes = new ArrayList<String>();
    processes.add("processes/signal.bpmn");
    processes.add("processes/import.bpmn");
    InternalKieModule kJar1 = createKieJar(ks, releaseId, processes);
    File pom = new File("target/kmodule", "pom.xml");
    pom.getParentFile().mkdir();
    try {
        FileOutputStream fs = new FileOutputStream(pom);
        fs.write(getPom(releaseId).getBytes());
        fs.close();
    } catch (Exception e) {
    }
    // second kjar
    ReleaseId releaseId2 = ks.newReleaseId(GROUP_ID2, ARTIFACT_ID2, VERSION2);
    List<String> processes2 = new ArrayList<String>();
    processes2.add("processes/customtask.bpmn");
    processes2.add("processes/humanTask.bpmn");
    InternalKieModule kJar2 = createKieJar(ks, releaseId2, processes2);
    File pom2 = new File("target/kmodule2", "pom.xml");
    pom2.getParentFile().mkdir();
    try {
        FileOutputStream fs = new FileOutputStream(pom2);
        fs.write(getPom(releaseId2).getBytes());
        fs.close();
    } catch (Exception e) {
    }
    KieMavenRepository repository = getKieMavenRepository();
    repository.installArtifact(releaseId, kJar1, pom);
    repository.installArtifact(releaseId2, kJar2, pom2);
}
Also used : FileOutputStream(java.io.FileOutputStream) ArrayList(java.util.ArrayList) KieMavenRepository.getKieMavenRepository(org.kie.scanner.KieMavenRepository.getKieMavenRepository) KieMavenRepository(org.kie.scanner.KieMavenRepository) KieServices(org.kie.api.KieServices) ReleaseId(org.kie.api.builder.ReleaseId) File(java.io.File) SessionNotFoundException(org.kie.internal.runtime.manager.SessionNotFoundException) EJBException(javax.ejb.EJBException) InternalKieModule(org.drools.compiler.kie.builder.impl.InternalKieModule)

Aggregations

KieMavenRepository (org.kie.scanner.KieMavenRepository)58 KieMavenRepository.getKieMavenRepository (org.kie.scanner.KieMavenRepository.getKieMavenRepository)55 KieServices (org.kie.api.KieServices)54 ReleaseId (org.kie.api.builder.ReleaseId)53 File (java.io.File)51 InternalKieModule (org.drools.compiler.kie.builder.impl.InternalKieModule)51 FileOutputStream (java.io.FileOutputStream)45 ArrayList (java.util.ArrayList)42 Before (org.junit.Before)32 KModuleDeploymentUnit (org.jbpm.kie.services.impl.KModuleDeploymentUnit)17 HashMap (java.util.HashMap)15 ProcessInstanceNotFoundException (org.jbpm.services.api.ProcessInstanceNotFoundException)15 DeploymentDescriptorImpl (org.jbpm.runtime.manager.impl.deploy.DeploymentDescriptorImpl)12 DeploymentDescriptor (org.kie.internal.runtime.conf.DeploymentDescriptor)12 Test (org.junit.Test)10 KieContainer (org.kie.api.runtime.KieContainer)7 DeployedUnit (org.jbpm.services.api.model.DeployedUnit)5 ObjectModel (org.kie.internal.runtime.conf.ObjectModel)5 IOException (java.io.IOException)4 AbstractKieServicesBaseTest (org.jbpm.kie.test.util.AbstractKieServicesBaseTest)4