use of pro.taskana.AttachmentSummary in project taskana by Taskana.
the class TaskImpl method asSummary.
@Override
public TaskSummary asSummary() {
TaskSummaryImpl taskSummary = new TaskSummaryImpl();
List<AttachmentSummary> attSummaries = new ArrayList<>();
for (Attachment att : attachments) {
attSummaries.add(att.asSummary());
}
taskSummary.setAttachmentSummaries(attSummaries);
taskSummary.setBusinessProcessId(this.businessProcessId);
taskSummary.setClaimed(claimed);
if (classificationSummary != null) {
taskSummary.setClassificationSummary(classificationSummary);
}
taskSummary.setCompleted(completed);
taskSummary.setCreated(created);
taskSummary.setCustom1(custom1);
taskSummary.setCustom2(custom2);
taskSummary.setCustom3(custom3);
taskSummary.setCustom4(custom4);
taskSummary.setCustom5(custom5);
taskSummary.setCustom6(custom6);
taskSummary.setCustom7(custom7);
taskSummary.setCustom8(custom8);
taskSummary.setCustom9(custom9);
taskSummary.setCustom10(custom10);
taskSummary.setDue(due);
taskSummary.setTaskId(id);
taskSummary.setModified(modified);
taskSummary.setName(name);
taskSummary.setCreator(creator);
taskSummary.setNote(note);
taskSummary.setOwner(owner);
taskSummary.setParentBusinessProcessId(parentBusinessProcessId);
taskSummary.setPlanned(planned);
taskSummary.setPrimaryObjRef(primaryObjRef);
taskSummary.setPriority(priority);
taskSummary.setRead(isRead);
taskSummary.setState(state);
taskSummary.setTransferred(isTransferred);
taskSummary.setWorkbasketSummary(workbasketSummary);
return taskSummary;
}
use of pro.taskana.AttachmentSummary 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