use of pro.taskana.TaskSummary in project taskana by Taskana.
the class QueryTasksAccTest method testQueryForCustom7.
@WithAccessId(userName = "teamlead_1", groupNames = { "group_1" })
@Test
public void testQueryForCustom7() throws SQLException, NotAuthorizedException, InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery().customAttributeLike("7", "%a%", "%b%", "%c%", "%d%", "%e%", "%f%", "%g%", "%h%", "%i%", "%j%", "%k%", "%l%", "%m%", "%n%", "%o%", "%p%", "%q%", "%r%", "%s%", "%w%").list();
assertThat(results.size(), equalTo(1));
String[] ids = results.stream().map(t -> {
try {
return t.getCustomAttribute("7");
} catch (InvalidArgumentException e) {
e.printStackTrace();
return "";
}
}).collect(Collectors.toList()).toArray(new String[0]);
List<TaskSummary> result2 = taskService.createTaskQuery().customAttributeIn("7", ids).list();
assertThat(result2.size(), equalTo(1));
}
use of pro.taskana.TaskSummary in project taskana by Taskana.
the class QueryTasksAccTest method testQueryForCustom10.
@WithAccessId(userName = "teamlead_1", groupNames = { "group_1" })
@Test
public void testQueryForCustom10() throws SQLException, NotAuthorizedException, InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery().customAttributeLike("10", "%a%", "%b%", "%c%", "%d%", "%e%", "%f%", "%g%", "%h%", "%i%", "%j%", "%k%", "%l%", "%m%", "%n%", "%o%", "%p%", "%q%", "%r%", "%s%", "%w%").list();
assertThat(results.size(), equalTo(2));
String[] ids = results.stream().map(t -> {
try {
return t.getCustomAttribute("10");
} catch (InvalidArgumentException e) {
e.printStackTrace();
return "";
}
}).collect(Collectors.toList()).toArray(new String[0]);
List<TaskSummary> result2 = taskService.createTaskQuery().customAttributeIn("10", ids).list();
assertThat(result2.size(), equalTo(2));
}
use of pro.taskana.TaskSummary in project taskana by Taskana.
the class QueryTasksAccTest method testQueryForCustom1.
@WithAccessId(userName = "teamlead_1", groupNames = { "group_1" })
@Test
public void testQueryForCustom1() throws SQLException, NotAuthorizedException, InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery().customAttributeLike("1", "%a%", "%b%", "%c%", "%d%", "%e%", "%f%", "%g%", "%h%", "%i%", "%j%", "%k%", "%l%", "%m%", "%n%", "%o%", "%p%", "%q%", "%r%", "%s%", "%w%").list();
assertThat(results.size(), equalTo(2));
String[] ids = results.stream().map(t -> {
try {
return t.getCustomAttribute("1");
} catch (InvalidArgumentException e) {
e.printStackTrace();
return "";
}
}).collect(Collectors.toList()).toArray(new String[0]);
List<TaskSummary> result2 = taskService.createTaskQuery().customAttributeIn("1", ids).list();
assertThat(result2.size(), equalTo(2));
}
use of pro.taskana.TaskSummary in project taskana by Taskana.
the class QueryTasksAccTest method testQueryForCustom3.
@WithAccessId(userName = "teamlead_1", groupNames = { "group_1" })
@Test
public void testQueryForCustom3() throws SQLException, NotAuthorizedException, InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery().customAttributeLike("3", "%a%", "%b%", "%c%", "%d%", "%e%", "%f%", "%g%", "%h%", "%i%", "%j%", "%k%", "%l%", "%m%", "%n%", "%o%", "%p%", "%q%", "%r%", "%s%", "%w%").list();
assertThat(results.size(), equalTo(1));
String[] ids = results.stream().map(t -> {
try {
return t.getCustomAttribute("3");
} catch (InvalidArgumentException e) {
e.printStackTrace();
return "";
}
}).collect(Collectors.toList()).toArray(new String[0]);
List<TaskSummary> result2 = taskService.createTaskQuery().customAttributeIn("3", ids).list();
assertThat(result2.size(), equalTo(1));
}
use of pro.taskana.TaskSummary in project taskana by Taskana.
the class QueryTasksAccTest method testQueryForAttachmentInSummary.
@WithAccessId(userName = "teamlead_1", groupNames = { "group_1" })
@Test
public void testQueryForAttachmentInSummary() throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException, TaskNotFoundException, WorkbasketNotFoundException, ConcurrencyException, InvalidWorkbasketException, AttachmentPersistenceException {
TaskService taskService = taskanaEngine.getTaskService();
Attachment attachment = createAttachment(// prio 99, SL P2000D
"DOCTYPE_DEFAULT", createObjectReference("COMPANY_A", "SYSTEM_B", "INSTANCE_B", "ArchiveId", "12345678901234567890123456789012345678901234567890"), "E-MAIL", "2018-01-15", createSimpleCustomProperties(3));
Task task = taskService.getTask("TKI:000000000000000000000000000000000000");
task.addAttachment(attachment);
taskService.updateTask(task);
List<TaskSummary> results = taskService.createTaskQuery().idIn("TKI:000000000000000000000000000000000000").list();
assertThat(results.size(), equalTo(1));
assertThat(results.get(0).getAttachmentSummaries().size(), equalTo(3));
AttachmentSummary att = results.get(0).getAttachmentSummaries().get(0);
}
Aggregations