Search in sources :

Example 96 with DeploymentUnit

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

the class SupportProcessBaseTest method cleanup.

@After
public void cleanup() {
    DebugTaskLifeCycleEventListener.resetEventCounter();
    TestUtil.cleanupSingletonSessionId();
    if (units != null && !units.isEmpty()) {
        for (DeploymentUnit unit : units) {
            deploymentService.undeploy(unit);
        }
        units.clear();
    }
}
Also used : DeploymentUnit(org.jbpm.services.api.model.DeploymentUnit) KModuleDeploymentUnit(org.jbpm.kie.services.impl.KModuleDeploymentUnit) After(org.junit.After)

Example 97 with DeploymentUnit

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

the class RuntimeDataServiceEJBIntegrationTest method cleanup.

@After
public void cleanup() {
    if (processInstanceId != null) {
        // let's abort process instance to leave the system in clear state
        processService.abortProcessInstance(processInstanceId);
        ProcessInstance pi = processService.getProcessInstance(processInstanceId);
        assertNull(pi);
    }
    int deleted = 0;
    deleted += commandService.execute(new UpdateStringCommand("delete from  NodeInstanceLog nid"));
    deleted += commandService.execute(new UpdateStringCommand("delete from  ProcessInstanceLog pid"));
    deleted += commandService.execute(new UpdateStringCommand("delete from  VariableInstanceLog vsd"));
    deleted += commandService.execute(new UpdateStringCommand("delete from  AuditTaskImpl vsd"));
    System.out.println("Deleted " + deleted);
    cleanupSingletonSessionId();
    if (units != null && !units.isEmpty()) {
        for (DeploymentUnit unit : units) {
            deploymentService.undeploy(unit);
        }
        units.clear();
    }
}
Also used : UpdateStringCommand(org.jbpm.shared.services.impl.commands.UpdateStringCommand) ProcessInstance(org.kie.api.runtime.process.ProcessInstance) KModuleDeploymentUnit(org.jbpm.kie.services.impl.KModuleDeploymentUnit) DeploymentUnit(org.jbpm.services.api.model.DeploymentUnit) After(org.junit.After)

Example 98 with DeploymentUnit

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

the class RuntimeDataServiceImplSecurityTest method cleanup.

@After
public void cleanup() {
    if (processInstanceId != null) {
        // let's abort process instance to leave the system in clear state
        processService.abortProcessInstance(processInstanceId);
        ProcessInstance pi = processService.getProcessInstance(processInstanceId);
        assertNull(pi);
    }
    int deleted = 0;
    deleted += commandService.execute(new UpdateStringCommand("delete from  NodeInstanceLog nid"));
    deleted += commandService.execute(new UpdateStringCommand("delete from  ProcessInstanceLog pid"));
    deleted += commandService.execute(new UpdateStringCommand("delete from  VariableInstanceLog vsd"));
    deleted += commandService.execute(new UpdateStringCommand("delete from  AuditTaskImpl vsd"));
    System.out.println("Deleted " + deleted);
    cleanupSingletonSessionId();
    if (units != null && !units.isEmpty()) {
        for (DeploymentUnit unit : units) {
            deploymentService.undeploy(unit);
        }
        units.clear();
    }
}
Also used : UpdateStringCommand(org.jbpm.shared.services.impl.commands.UpdateStringCommand) ProcessInstance(org.kie.api.runtime.process.ProcessInstance) DeploymentUnit(org.jbpm.services.api.model.DeploymentUnit) KModuleDeploymentUnit(org.jbpm.kie.services.impl.KModuleDeploymentUnit) After(org.junit.After)

Example 99 with DeploymentUnit

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

the class DefinitionServiceEJBIntegrationTest method testHiringProcessData.

@Test
public void testHiringProcessData() throws IOException {
    assertNotNull(deploymentService);
    DeploymentUnit deploymentUnit = new KModuleDeploymentUnit(GROUP_ID, ARTIFACT_ID, VERSION);
    deploymentService.deploy(deploymentUnit);
    units.add(deploymentUnit);
    String processId = "hiring";
    Collection<UserTaskDefinition> processTasks = bpmn2Service.getTasksDefinitions(deploymentUnit.getIdentifier(), processId);
    assertEquals(4, processTasks.size());
    Map<String, String> processData = bpmn2Service.getProcessVariables(deploymentUnit.getIdentifier(), processId);
    assertEquals(9, processData.keySet().size());
    Map<String, String> taskInputMappings = bpmn2Service.getTaskInputMappings(deploymentUnit.getIdentifier(), processId, "HR Interview");
    assertEquals(4, taskInputMappings.keySet().size());
    assertEquals("java.lang.String", taskInputMappings.get("TaskName"));
    assertEquals("Object", taskInputMappings.get("GroupId"));
    assertEquals("Object", taskInputMappings.get("Comment"));
    assertEquals("String", taskInputMappings.get("in_name"));
    Map<String, String> taskOutputMappings = bpmn2Service.getTaskOutputMappings(deploymentUnit.getIdentifier(), processId, "HR Interview");
    assertEquals(4, taskOutputMappings.keySet().size());
    assertEquals("String", taskOutputMappings.get("out_name"));
    assertEquals("Integer", taskOutputMappings.get("out_age"));
    assertEquals("String", taskOutputMappings.get("out_mail"));
    assertEquals("Integer", taskOutputMappings.get("out_score"));
    Map<String, Collection<String>> associatedEntities = bpmn2Service.getAssociatedEntities(deploymentUnit.getIdentifier(), processId);
    assertEquals(4, associatedEntities.keySet().size());
    Map<String, String> allServiceTasks = bpmn2Service.getServiceTasks(deploymentUnit.getIdentifier(), processId);
    assertEquals(2, allServiceTasks.keySet().size());
}
Also used : UserTaskDefinition(org.jbpm.services.api.model.UserTaskDefinition) Collection(java.util.Collection) KModuleDeploymentUnit(org.jbpm.kie.services.impl.KModuleDeploymentUnit) DeploymentUnit(org.jbpm.services.api.model.DeploymentUnit) KModuleDeploymentUnit(org.jbpm.kie.services.impl.KModuleDeploymentUnit) Test(org.junit.Test)

Example 100 with DeploymentUnit

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

the class DefinitionServiceEJBIntegrationTest method itemRefIssue.

@Test
public void itemRefIssue() {
    assertNotNull(deploymentService);
    DeploymentUnit deploymentUnit = new KModuleDeploymentUnit(GROUP_ID, ARTIFACT_ID, VERSION);
    deploymentService.deploy(deploymentUnit);
    units.add(deploymentUnit);
    String processId = "itemrefissue";
    Map<String, String> processData = bpmn2Service.getProcessVariables(deploymentUnit.getIdentifier(), processId);
    assertNotNull(processData);
}
Also used : KModuleDeploymentUnit(org.jbpm.kie.services.impl.KModuleDeploymentUnit) DeploymentUnit(org.jbpm.services.api.model.DeploymentUnit) KModuleDeploymentUnit(org.jbpm.kie.services.impl.KModuleDeploymentUnit) Test(org.junit.Test)

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