Search in sources :

Example 6 with TaskInstanceView

use of org.jbpm.persistence.api.integration.model.TaskInstanceView in project jbpm by kiegroup.

the class JPATaskPersistenceContext method addAttachmentToTask.

@Override
public Attachment addAttachmentToTask(Attachment attachment, Task task) {
    ((InternalTaskData) task.getTaskData()).addAttachment(attachment);
    EventManagerProvider.getInstance().get().update(new TaskInstanceView(task));
    return attachment;
}
Also used : TaskInstanceView(org.jbpm.persistence.api.integration.model.TaskInstanceView) InternalTaskData(org.kie.internal.task.api.model.InternalTaskData)

Example 7 with TaskInstanceView

use of org.jbpm.persistence.api.integration.model.TaskInstanceView in project jbpm by kiegroup.

the class JPATaskPersistenceContext method removeAttachmentFromTask.

@Override
public Attachment removeAttachmentFromTask(Task task, long attachmentId) {
    Attachment removed = ((InternalTaskData) task.getTaskData()).removeAttachment(attachmentId);
    EventManagerProvider.getInstance().get().update(new TaskInstanceView(task));
    return removed;
}
Also used : TaskInstanceView(org.jbpm.persistence.api.integration.model.TaskInstanceView) InternalTaskData(org.kie.internal.task.api.model.InternalTaskData) Attachment(org.kie.api.task.model.Attachment)

Aggregations

TaskInstanceView (org.jbpm.persistence.api.integration.model.TaskInstanceView)7 InternalTaskData (org.kie.internal.task.api.model.InternalTaskData)4 Attachment (org.kie.api.task.model.Attachment)1 Task (org.kie.api.task.model.Task)1