use of org.kie.kogito.process.workitem.Attachment in project kogito-runtimes by kiegroup.
the class HumanTaskHelper method deleteAttachment.
public static boolean deleteAttachment(KogitoWorkItem item, Object id, String user) {
Map<Object, Attachment> attachments = asHumanTask(item).getAttachments();
Attachment attachment = attachments.get(id);
if (attachment == null || !attachment.getUpdatedBy().equals(user)) {
return false;
}
return attachments.remove(id) != null;
}
use of org.kie.kogito.process.workitem.Attachment in project kogito-runtimes by kiegroup.
the class HumanTaskHelper method addAttachment.
public static Attachment addAttachment(KogitoWorkItem item, AttachmentInfo attachmentInfo, String user) {
HumanTaskWorkItemImpl humanTask = asHumanTask(item);
Object id = getNewId();
Attachment attachment = buildAttachment(id, attachmentInfo, user);
humanTask.getAttachments().put(id, attachment);
return attachment;
}
Aggregations