Search in sources :

Example 1 with AttachmentSummary

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;
}
Also used : ArrayList(java.util.ArrayList) Attachment(pro.taskana.Attachment) AttachmentSummary(pro.taskana.AttachmentSummary)

Example 2 with AttachmentSummary

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);
}
Also used : Task(pro.taskana.Task) TaskService(pro.taskana.TaskService) TaskSummary(pro.taskana.TaskSummary) Attachment(pro.taskana.Attachment) AttachmentSummary(pro.taskana.AttachmentSummary) TaskanaEngineProxyForTest(pro.taskana.impl.TaskanaEngineProxyForTest) AbstractAccTest(acceptance.AbstractAccTest) Test(org.junit.Test) WithAccessId(pro.taskana.security.WithAccessId)

Aggregations

Attachment (pro.taskana.Attachment)2 AttachmentSummary (pro.taskana.AttachmentSummary)2 AbstractAccTest (acceptance.AbstractAccTest)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1 Task (pro.taskana.Task)1 TaskService (pro.taskana.TaskService)1 TaskSummary (pro.taskana.TaskSummary)1 TaskanaEngineProxyForTest (pro.taskana.impl.TaskanaEngineProxyForTest)1 WithAccessId (pro.taskana.security.WithAccessId)1