use of org.kie.server.api.model.instance.TaskSummary in project droolsjbpm-integration by kiegroup.
the class TaskSearchServiceIntegrationTest method testFindTaskWithTaskIdEqualsToFilter.
@Test
public void testFindTaskWithTaskIdEqualsToFilter() throws Exception {
Long processInstanceId = processClient.startProcess(CONTAINER_ID, PROCESS_ID_USERTASK);
Assertions.assertThat(processInstanceId).isNotNull();
List<TaskSummary> tasks = taskClient.findTasksAssignedAsPotentialOwner(USER_YODA, 0, 10);
Assertions.assertThat(tasks).isNotEmpty();
TaskSummary task = tasks.get(0);
testFindTaskInstanceWithSearchService(createQueryFilterEqualsTo(TaskField.TASKID, task.getId()), task.getId());
}
use of org.kie.server.api.model.instance.TaskSummary in project droolsjbpm-integration by kiegroup.
the class TaskSearchServiceIntegrationTest method testFindTaskWithParentIdGreaterThanAndEqualsToFilter.
@Test
public void testFindTaskWithParentIdGreaterThanAndEqualsToFilter() throws Exception {
Long processInstanceId = processClient.startProcess(CONTAINER_ID, PROCESS_ID_USERTASK);
Assertions.assertThat(processInstanceId).isNotNull();
List<TaskSummary> tasks = taskClient.findTasksAssignedAsPotentialOwner(USER_YODA, 0, 10);
Assertions.assertThat(tasks).isNotEmpty();
TaskSummary task = tasks.get(0);
testFindTaskInstanceWithSearchService(createQueryFilterGreaterThanAndEqualsTo(TaskField.PARENTID, -2, -1), task.getId());
}
use of org.kie.server.api.model.instance.TaskSummary in project droolsjbpm-integration by kiegroup.
the class TaskSearchServiceIntegrationTest method testFindTaskWithCreatedOnGreaterThanOrEqualsToFilter.
@Test
public void testFindTaskWithCreatedOnGreaterThanOrEqualsToFilter() throws Exception {
Long processInstanceId = processClient.startProcess(CONTAINER_ID, PROCESS_ID_USERTASK);
Assertions.assertThat(processInstanceId).isNotNull();
List<TaskSummary> tasks = taskClient.findTasksAssignedAsPotentialOwner(USER_YODA, 0, 10);
Assertions.assertThat(tasks).isNotEmpty();
TaskSummary task = tasks.get(0);
testFindTaskInstanceWithSearchService(createQueryFilterGreaterThanOrEqualsTo(TaskField.CREATEDON, subtractOneMinuteFromDate(task.getCreatedOn())), task.getId());
}
use of org.kie.server.api.model.instance.TaskSummary in project droolsjbpm-integration by kiegroup.
the class TaskSearchServiceIntegrationTest method testFindTaskWithDeploymentIdEqualsToFilter.
@Test
public void testFindTaskWithDeploymentIdEqualsToFilter() throws Exception {
Long processInstanceId = processClient.startProcess(CONTAINER_ID, PROCESS_ID_USERTASK);
Assertions.assertThat(processInstanceId).isNotNull();
List<TaskSummary> tasks = taskClient.findTasksAssignedAsPotentialOwner(USER_YODA, 0, 10);
Assertions.assertThat(tasks).isNotEmpty();
TaskSummary task = tasks.get(0);
testFindTaskInstanceWithSearchService(createQueryFilterEqualsTo(TaskField.DEPLOYMENTID, CONTAINER_ID), task.getId());
}
use of org.kie.server.api.model.instance.TaskSummary in project droolsjbpm-integration by kiegroup.
the class UserTaskEscalationIntegrationTest method testCompleteTaskBeforeEscalation.
@Test
@Category(Unstable.class)
public void testCompleteTaskBeforeEscalation() throws InterruptedException {
// Unstable on slow DBs where starting of task is called after escalation timeout.
Long processInstanceId = processClient.startProcess(CONTAINER_ID, PROCESS_ID_USERTASK_ESCALATION, params);
assertNotNull(processInstanceId);
assertTrue(processInstanceId > 0);
List<TaskSummary> taskList = taskClient.findTasksAssignedAsPotentialOwner(USER_YODA, 0, 10);
assertNotNull(taskList);
assertEquals(1, taskList.size());
TaskSummary taskSummary = taskList.get(0);
assertEquals("User Task", taskSummary.getName());
Long taskId = taskSummary.getId();
taskClient.startTask(CONTAINER_ID, taskId, USER_YODA);
taskClient.completeTask(CONTAINER_ID, taskId, USER_YODA, new HashMap<String, Object>());
ProcessInstance processInstance = processClient.getProcessInstance(CONTAINER_ID, processInstanceId);
assertNotNull(processInstance);
assertEquals(org.kie.api.runtime.process.ProcessInstance.STATE_COMPLETED, processInstance.getState().intValue());
KieServerAssert.assertNullOrEmpty("Email received!", wiser.getMessages());
// wait while, cause email is sent 6s after task start
Thread.sleep(8000L);
KieServerAssert.assertNullOrEmpty("Email received!", wiser.getMessages());
}
Aggregations