Search in sources :

Example 6 with DeploymentUnit

use of org.jbpm.services.api.model.DeploymentUnit in project jbpm by kiegroup.

the class EDeploymentTest method testDuplicateDeploy.

@Test
public void testDuplicateDeploy() {
    DeploymentUnit basicKieJar = archive.deployBasicKieJar();
    try {
        deploymentService.deploy(basicKieJar);
        // An exception should be thrown
        Assertions.assertThat(false).isTrue();
    } catch (Exception ex) {
        Assertions.assertThat(ex.getMessage()).contains(basicKieJar.getIdentifier() + " is already deployed");
    }
}
Also used : DeploymentUnit(org.jbpm.services.api.model.DeploymentUnit) Test(org.junit.Test) AbstractEJBServicesTest(org.jbpm.test.container.AbstractEJBServicesTest)

Example 7 with DeploymentUnit

use of org.jbpm.services.api.model.DeploymentUnit in project jbpm by kiegroup.

the class EDeploymentTest method testDeploy.

@Test
public void testDeploy() throws Exception {
    DeploymentUnit basicKieJar = archive.deployBasicKieJar();
    DeployedUnit deployed = deploymentService.getDeployedUnit(basicKieJar.getIdentifier());
    Assertions.assertThat(deployed).isNotNull();
    Assertions.assertThat(deployed.getDeploymentUnit()).isNotNull();
    Assertions.assertThat(deployed.getDeploymentUnit()).isEqualTo(basicKieJar);
    Assertions.assertThat(deployed.getRuntimeManager()).isNotNull();
    Collection<ProcessDefinition> processes = runtimeDataService.getProcesses(new QueryContext());
    Assertions.assertThat(processes).isNotNull().isNotEmpty();
}
Also used : DeployedUnit(org.jbpm.services.api.model.DeployedUnit) ProcessDefinition(org.jbpm.services.api.model.ProcessDefinition) QueryContext(org.kie.internal.query.QueryContext) DeploymentUnit(org.jbpm.services.api.model.DeploymentUnit) Test(org.junit.Test) AbstractEJBServicesTest(org.jbpm.test.container.AbstractEJBServicesTest)

Example 8 with DeploymentUnit

use of org.jbpm.services.api.model.DeploymentUnit in project jbpm by kiegroup.

the class EJBService method deployEJBComplianceKieJar.

public DeploymentUnit deployEJBComplianceKieJar() {
    KieServices ks = KieServices.Factory.get();
    ReleaseId releaseId = ks.newReleaseId(KieJar.EJBCOMPL.groupId, KieJar.EJBCOMPL.artifactId, KieJar.EJBCOMPL.version);
    List<String> assets = new ArrayList<String>();
    assets.add("ThreadInfo.bpmn2");
    assets.add("TxRules.drl");
    assets.add("hello-world_1.0.bpmn");
    deployKieJar(ks, releaseId, assets);
    DeploymentUnit deploymentUnit = new KModuleDeploymentUnit(KieJar.EJBCOMPL.getGroupId(), KieJar.EJBCOMPL.getArtifactId(), KieJar.EJBCOMPL.getVersion());
    deploymentService.deploy(deploymentUnit);
    units.add(deploymentUnit);
    return deploymentUnit;
}
Also used : ArrayList(java.util.ArrayList) KieServices(org.kie.api.KieServices) ReleaseId(org.kie.api.builder.ReleaseId) KModuleDeploymentUnit(org.jbpm.kie.services.impl.KModuleDeploymentUnit) DeploymentUnit(org.jbpm.services.api.model.DeploymentUnit) KModuleDeploymentUnit(org.jbpm.kie.services.impl.KModuleDeploymentUnit)

Example 9 with DeploymentUnit

use of org.jbpm.services.api.model.DeploymentUnit in project jbpm by kiegroup.

the class EJBService method deployVariableKieJar.

public DeploymentUnit deployVariableKieJar() {
    KieServices ks = KieServices.Factory.get();
    ReleaseId releaseId = ks.newReleaseId(KieJar.VARIABLE.groupId, KieJar.VARIABLE.artifactId, KieJar.VARIABLE.version);
    List<String> assets = new ArrayList<String>();
    assets.add("ObjectVariableProcess.bpmn2");
    deployKieJar(ks, releaseId, assets);
    DeploymentUnit deploymentUnit = new KModuleDeploymentUnit(KieJar.VARIABLE.getGroupId(), KieJar.VARIABLE.getArtifactId(), KieJar.VARIABLE.getVersion());
    deploymentService.deploy(deploymentUnit);
    units.add(deploymentUnit);
    return deploymentUnit;
}
Also used : ArrayList(java.util.ArrayList) KieServices(org.kie.api.KieServices) ReleaseId(org.kie.api.builder.ReleaseId) KModuleDeploymentUnit(org.jbpm.kie.services.impl.KModuleDeploymentUnit) DeploymentUnit(org.jbpm.services.api.model.DeploymentUnit) KModuleDeploymentUnit(org.jbpm.kie.services.impl.KModuleDeploymentUnit)

Example 10 with DeploymentUnit

use of org.jbpm.services.api.model.DeploymentUnit in project jbpm by kiegroup.

the class EJBService method deployServiceKieJar.

public DeploymentUnit deployServiceKieJar() {
    KieServices ks = KieServices.Factory.get();
    ReleaseId releaseId = ks.newReleaseId(KieJar.SERVICE.groupId, KieJar.SERVICE.artifactId, KieJar.SERVICE.version);
    List<String> assets = new ArrayList<String>();
    assets.add("RestWorkItem.bpmn2");
    deployKieJar(ks, releaseId, assets);
    DeploymentUnit deploymentUnit = new KModuleDeploymentUnit(KieJar.SERVICE.getGroupId(), KieJar.SERVICE.getArtifactId(), KieJar.SERVICE.getVersion());
    deploymentService.deploy(deploymentUnit);
    units.add(deploymentUnit);
    return deploymentUnit;
}
Also used : ArrayList(java.util.ArrayList) KieServices(org.kie.api.KieServices) ReleaseId(org.kie.api.builder.ReleaseId) KModuleDeploymentUnit(org.jbpm.kie.services.impl.KModuleDeploymentUnit) DeploymentUnit(org.jbpm.services.api.model.DeploymentUnit) KModuleDeploymentUnit(org.jbpm.kie.services.impl.KModuleDeploymentUnit)

Aggregations

DeploymentUnit (org.jbpm.services.api.model.DeploymentUnit)104 KModuleDeploymentUnit (org.jbpm.kie.services.impl.KModuleDeploymentUnit)88 Test (org.junit.Test)53 After (org.junit.After)35 AbstractKieServicesBaseTest (org.jbpm.kie.test.util.AbstractKieServicesBaseTest)34 DeployedUnit (org.jbpm.services.api.model.DeployedUnit)28 ProcessInstance (org.kie.api.runtime.process.ProcessInstance)25 ProcessDefinition (org.jbpm.services.api.model.ProcessDefinition)19 HashMap (java.util.HashMap)16 RuntimeManager (org.kie.api.runtime.manager.RuntimeManager)15 ArrayList (java.util.ArrayList)14 ProcessInstanceNotFoundException (org.jbpm.services.api.ProcessInstanceNotFoundException)13 QueryContext (org.kie.api.runtime.query.QueryContext)13 RuntimeEngine (org.kie.api.runtime.manager.RuntimeEngine)12 KieServices (org.kie.api.KieServices)10 ReleaseId (org.kie.api.builder.ReleaseId)10 InternalRuntimeManager (org.kie.internal.runtime.manager.InternalRuntimeManager)9 AbstractEJBServicesTest (org.jbpm.test.container.AbstractEJBServicesTest)8 Collection (java.util.Collection)6 DeployedUnitImpl (org.jbpm.kie.services.impl.DeployedUnitImpl)6