Search in sources :

Example 11 with TaskSummary

use of org.kie.server.api.model.instance.TaskSummary in project droolsjbpm-integration by kiegroup.

the class TaskSearchServiceIntegrationTest method testFindTaskWithDescriptionEqualsToFilter.

@Test
public void testFindTaskWithDescriptionEqualsToFilter() 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.DESCRIPTION, task.getDescription()), task.getId());
}
Also used : TaskSummary(org.kie.server.api.model.instance.TaskSummary) Test(org.junit.Test)

Example 12 with TaskSummary

use of org.kie.server.api.model.instance.TaskSummary in project droolsjbpm-integration by kiegroup.

the class TaskSearchServiceIntegrationTest method testFindTaskWithActualOwnerEqualsToFilter.

@Test
public void testFindTaskWithActualOwnerEqualsToFilter() 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.ACTUALOWNER, USER_YODA), task.getId());
}
Also used : TaskSummary(org.kie.server.api.model.instance.TaskSummary) Test(org.junit.Test)

Example 13 with TaskSummary

use of org.kie.server.api.model.instance.TaskSummary in project droolsjbpm-integration by kiegroup.

the class TaskSearchServiceIntegrationTest method testFindTaskWithActivationTimeGreaterThanEqualsToFilter.

@Test
public void testFindTaskWithActivationTimeGreaterThanEqualsToFilter() 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.ACTIVATIONTIME, subtractOneMinuteFromDate(task.getActivationTime())), task.getId());
}
Also used : TaskSummary(org.kie.server.api.model.instance.TaskSummary) Test(org.junit.Test)

Example 14 with TaskSummary

use of org.kie.server.api.model.instance.TaskSummary in project droolsjbpm-integration by kiegroup.

the class TaskSearchServiceIntegrationTest method testFindTaskWithProcessInstanceIdEqualsToFilter.

@Test
public void testFindTaskWithProcessInstanceIdEqualsToFilter() 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.PROCESSINSTANCEID, processInstanceId), task.getId());
}
Also used : TaskSummary(org.kie.server.api.model.instance.TaskSummary) Test(org.junit.Test)

Example 15 with TaskSummary

use of org.kie.server.api.model.instance.TaskSummary in project droolsjbpm-integration by kiegroup.

the class TaskSearchServiceIntegrationTest method testFindTaskWithProcessIdEqualsToFilter.

@Test
public void testFindTaskWithProcessIdEqualsToFilter() 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.PROCESSID, PROCESS_ID_USERTASK), task.getId());
}
Also used : TaskSummary(org.kie.server.api.model.instance.TaskSummary) Test(org.junit.Test)

Aggregations

TaskSummary (org.kie.server.api.model.instance.TaskSummary)142 Test (org.junit.Test)131 HashMap (java.util.HashMap)79 JbpmKieServerBaseIntegrationTest (org.kie.server.integrationtests.jbpm.JbpmKieServerBaseIntegrationTest)39 ProcessInstance (org.kie.server.api.model.instance.ProcessInstance)31 TaskInstance (org.kie.server.api.model.instance.TaskInstance)28 ArrayList (java.util.ArrayList)24 OrgEntities (org.kie.server.api.model.admin.OrgEntities)21 KieServicesException (org.kie.server.api.exception.KieServicesException)14 Category (org.junit.experimental.categories.Category)7 NodeInstance (org.kie.server.api.model.instance.NodeInstance)7 Date (java.util.Date)6 CaseInstance (org.kie.server.api.model.cases.CaseInstance)6 TaskEventInstance (org.kie.server.api.model.instance.TaskEventInstance)6 WorkItemInstance (org.kie.server.api.model.instance.WorkItemInstance)6 ProcessDefinition (org.kie.server.api.model.definition.ProcessDefinition)5 ProcessServicesClient (org.kie.server.client.ProcessServicesClient)5 UserTaskServicesClient (org.kie.server.client.UserTaskServicesClient)5 Calendar (java.util.Calendar)4 List (java.util.List)3