use of pro.taskana.TaskService in project taskana by Taskana.
the class QueryTasksByObjectReferenceAccTest method testQueryTasksByExcactValueOfObjectReference.
@WithAccessId(userName = "teamlead_1", groupNames = { "group_1", "group_2" })
@Test
public void testQueryTasksByExcactValueOfObjectReference() throws SQLException, NotAuthorizedException, InvalidArgumentException, SystemException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery().primaryObjectReferenceValueIn("11223344", "22334455").list();
Assert.assertEquals(32L, results.size());
}
use of pro.taskana.TaskService in project taskana by Taskana.
the class QueryTasksWithSortingAccTest method testSortByPorSystemNoteDueAndOwner.
@WithAccessId(userName = "teamlead_1", groupNames = { "group_1", "group_2" })
@Test
public void testSortByPorSystemNoteDueAndOwner() throws SQLException, NotAuthorizedException, InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery().workbasketKeyDomainIn(new KeyDomain("USER_3_2", "DOMAIN_B")).orderByPrimaryObjectReferenceSystem(SortDirection.DESCENDING).orderByNote(null).orderByDue(null).orderByOwner(asc).list();
assertThat(results.size(), equalTo(25));
TaskSummary previousSummary = null;
for (TaskSummary taskSummary : results) {
if (previousSummary != null) {
Assert.assertTrue(taskSummary.getPrimaryObjRef().getSystem().compareToIgnoreCase(previousSummary.getPrimaryObjRef().getSystem()) <= 0);
}
previousSummary = taskSummary;
}
}
use of pro.taskana.TaskService in project taskana by Taskana.
the class QueryTasksWithSortingAccTest method testSortByPorSystemInstanceParentProcPlannedAndState.
@WithAccessId(userName = "teamlead_1", groupNames = { "group_1", "group_2" })
@Test
public void testSortByPorSystemInstanceParentProcPlannedAndState() throws SQLException, NotAuthorizedException, InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery().workbasketKeyDomainIn(new KeyDomain("USER_3_2", "DOMAIN_B")).orderByPrimaryObjectReferenceSystemInstance(desc).orderByParentBusinessProcessId(asc).orderByPlanned(asc).orderByState(asc).list();
assertThat(results.size(), equalTo(25));
TaskSummary previousSummary = null;
for (TaskSummary taskSummary : results) {
if (previousSummary != null) {
Assert.assertTrue(taskSummary.getPrimaryObjRef().getSystemInstance().compareToIgnoreCase(previousSummary.getPrimaryObjRef().getSystemInstance()) <= 0);
}
previousSummary = taskSummary;
}
}
use of pro.taskana.TaskService in project taskana by Taskana.
the class QueryTasksWithSortingAccTest method testSortBpIdClassificationIdDescriptionAndPorType.
@WithAccessId(userName = "teamlead_1", groupNames = { "group_1", "group_2" })
@Test
public void testSortBpIdClassificationIdDescriptionAndPorType() throws SQLException, NotAuthorizedException, InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery().stateIn(TaskState.READY).workbasketIdIn("WBI:100000000000000000000000000000000015").orderByBusinessProcessId(asc).orderByClassificationKey(null).orderByPrimaryObjectReferenceType(SortDirection.DESCENDING).list();
assertThat(results.size(), equalTo(22));
TaskSummary previousSummary = null;
for (TaskSummary taskSummary : results) {
if (previousSummary != null) {
Assert.assertTrue(taskSummary.getBusinessProcessId().compareToIgnoreCase(previousSummary.getBusinessProcessId()) >= 0);
}
previousSummary = taskSummary;
}
}
use of pro.taskana.TaskService in project taskana by Taskana.
the class QueryTasksWithSortingAccTest method testSortByWbKeyPrioPorValueAndCompleted.
@WithAccessId(userName = "teamlead_1", groupNames = { "group_1", "group_2" })
@Test
public void testSortByWbKeyPrioPorValueAndCompleted() throws SQLException, NotAuthorizedException, InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery().stateIn(TaskState.READY).orderByWorkbasketKey(null).workbasketIdIn("WBI:100000000000000000000000000000000015").orderByPriority(desc).orderByPrimaryObjectReferenceValue(asc).orderByCompleted(desc).list();
assertThat(results.size(), equalTo(22));
TaskSummary previousSummary = null;
for (TaskSummary taskSummary : results) {
if (previousSummary != null) {
Assert.assertTrue(taskSummary.getWorkbasketSummary().getKey().compareToIgnoreCase(previousSummary.getWorkbasketSummary().getKey()) >= 0);
}
previousSummary = taskSummary;
}
}
Aggregations