Search in sources :

Example 6 with UserTaskDefinition

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

the class DefinitionServiceEJBIntegrationTest method testHumanTaskProcess.

@Test
public void testHumanTaskProcess() throws IOException {
    assertNotNull(deploymentService);
    DeploymentUnit deploymentUnit = new KModuleDeploymentUnit(GROUP_ID, ARTIFACT_ID, VERSION);
    deploymentService.deploy(deploymentUnit);
    units.add(deploymentUnit);
    String processId = "org.jbpm.writedocument";
    Collection<UserTaskDefinition> processTasks = bpmn2Service.getTasksDefinitions(deploymentUnit.getIdentifier(), processId);
    assertEquals(3, processTasks.size());
    Map<String, String> processData = bpmn2Service.getProcessVariables(deploymentUnit.getIdentifier(), processId);
    assertEquals(3, processData.keySet().size());
    Map<String, String> taskInputMappings = bpmn2Service.getTaskInputMappings(deploymentUnit.getIdentifier(), processId, "Write a Document");
    assertEquals(3, taskInputMappings.keySet().size());
    Map<String, String> taskOutputMappings = bpmn2Service.getTaskOutputMappings(deploymentUnit.getIdentifier(), processId, "Write a Document");
    assertEquals(1, taskOutputMappings.keySet().size());
    Map<String, Collection<String>> associatedEntities = bpmn2Service.getAssociatedEntities(deploymentUnit.getIdentifier(), processId);
    assertEquals(3, associatedEntities.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)

Aggregations

DeploymentUnit (org.jbpm.services.api.model.DeploymentUnit)6 UserTaskDefinition (org.jbpm.services.api.model.UserTaskDefinition)6 Test (org.junit.Test)6 Collection (java.util.Collection)5 KModuleDeploymentUnit (org.jbpm.kie.services.impl.KModuleDeploymentUnit)5 AbstractKieServicesBaseTest (org.jbpm.kie.test.util.AbstractKieServicesBaseTest)3 HashMap (java.util.HashMap)1 ProcessDefinition (org.jbpm.services.api.model.ProcessDefinition)1 AbstractEJBServicesTest (org.jbpm.test.container.AbstractEJBServicesTest)1