use of org.jbpm.services.api.model.UserTaskInstanceDesc in project jbpm by kiegroup.
the class UserTaskServiceEJBIntegrationTest method testSetPriority.
@Test
public void testSetPriority() {
processInstanceId = processService.startProcess(deploymentUnit.getIdentifier(), "org.jbpm.writedocument");
assertNotNull(processInstanceId);
List<Long> taskIds = runtimeDataService.getTasksByProcessInstanceId(processInstanceId);
assertNotNull(taskIds);
assertEquals(1, taskIds.size());
Long taskId = taskIds.get(0);
UserTaskInstanceDesc task = runtimeDataService.getTaskById(taskId);
assertNotNull(task);
assertEquals(Status.Reserved.toString(), task.getStatus());
assertEquals(0, (int) task.getPriority());
userTaskService.setPriority(taskId, 8);
task = runtimeDataService.getTaskById(taskId);
assertNotNull(task);
assertEquals(Status.Reserved.toString(), task.getStatus());
assertEquals(8, (int) task.getPriority());
}
use of org.jbpm.services.api.model.UserTaskInstanceDesc in project jbpm by kiegroup.
the class UserTaskServiceEJBIntegrationTest method testStartAndStop.
@Test
public void testStartAndStop() {
processInstanceId = processService.startProcess(deploymentUnit.getIdentifier(), "org.jbpm.writedocument");
assertNotNull(processInstanceId);
List<Long> taskIds = runtimeDataService.getTasksByProcessInstanceId(processInstanceId);
assertNotNull(taskIds);
assertEquals(1, taskIds.size());
Long taskId = taskIds.get(0);
userTaskService.start(taskId, "salaboy");
UserTaskInstanceDesc task = runtimeDataService.getTaskById(taskId);
assertNotNull(task);
assertEquals(Status.InProgress.toString(), task.getStatus());
userTaskService.stop(taskId, "salaboy");
task = runtimeDataService.getTaskById(taskId);
assertNotNull(task);
assertEquals(Status.Reserved.toString(), task.getStatus());
}
use of org.jbpm.services.api.model.UserTaskInstanceDesc in project jbpm by kiegroup.
the class UserTaskServiceEJBIntegrationTest method testSetDescription.
@Test
public void testSetDescription() {
processInstanceId = processService.startProcess(deploymentUnit.getIdentifier(), "org.jbpm.writedocument");
assertNotNull(processInstanceId);
List<Long> taskIds = runtimeDataService.getTasksByProcessInstanceId(processInstanceId);
assertNotNull(taskIds);
assertEquals(1, taskIds.size());
Long taskId = taskIds.get(0);
UserTaskInstanceDesc task = runtimeDataService.getTaskById(taskId);
assertNotNull(task);
assertEquals(Status.Reserved.toString(), task.getStatus());
assertEquals("Write a Document", task.getDescription());
userTaskService.setDescription(taskId, "updated");
task = runtimeDataService.getTaskById(taskId);
assertNotNull(task);
assertEquals(Status.Reserved.toString(), task.getStatus());
assertEquals("updated", task.getDescription());
}
use of org.jbpm.services.api.model.UserTaskInstanceDesc in project jbpm by kiegroup.
the class UserTaskServiceEJBIntegrationTest method testStartAndComplete.
@Test
public void testStartAndComplete() {
processInstanceId = processService.startProcess(deploymentUnit.getIdentifier(), "org.jbpm.writedocument");
assertNotNull(processInstanceId);
List<Long> taskIds = runtimeDataService.getTasksByProcessInstanceId(processInstanceId);
assertNotNull(taskIds);
assertEquals(1, taskIds.size());
Long taskId = taskIds.get(0);
userTaskService.start(taskId, "salaboy");
UserTaskInstanceDesc task = runtimeDataService.getTaskById(taskId);
assertNotNull(task);
assertEquals(Status.InProgress.toString(), task.getStatus());
Map<String, Object> results = new HashMap<String, Object>();
results.put("Result", "some document data");
userTaskService.complete(taskId, "salaboy", results);
task = runtimeDataService.getTaskById(taskId);
assertNotNull(task);
assertEquals(Status.Completed.toString(), task.getStatus());
}
use of org.jbpm.services.api.model.UserTaskInstanceDesc in project jbpm by kiegroup.
the class EGetTaskTest method testGetTaskInstanceInfo.
@Test
public void testGetTaskInstanceInfo() throws Exception {
Long processInstanceId = archive.startProcess(kieJar, HUMAN_TASK_PROCESS_ID);
Long taskId = runtimeDataService.getTasksByProcessInstanceId(processInstanceId).get(0);
UserTaskInstanceDesc task = runtimeDataService.getTaskById(taskId);
System.out.println(task.getActualOwner() + "," + task.getTaskId() + "," + task.getStatus());
Assertions.assertThat(userId).isEqualTo(task.getActualOwner());
Assertions.assertThat(Status.Reserved.name()).isEqualTo(task.getStatus());
}
Aggregations