JBoss Community

Re: notifications with attachments

created by Thomas Setiabudi in jBPM - View the full discussion

Hi jnorris,

 

Human Task by default support attachment,

 

here you go

 

Attachment attachment = new Attachment();
  attachment.setAccessType(AccessType.Inline);
  attachment.setAttachedAt(new java.util.Date());
  attachment.setAttachedBy(new User(userLogon));
  attachment.setContentType("image");
  attachment.setName("myTaskAttachment");
  attachment.setSize(20000);
 
 // file is a byte[] variable
  Content content = new Content(file);
  attachment.setContent(content);
 
 TaskClient taskClient = getTaskClient();
  BlockingAddAttachmentResponseHandler responseHandler = new BlockingAddAttachmentResponseHandler();
  taskClient.addAttachment(taskId, attachment, content, responseHandler);
  Map<String, Long> result = new HashMap<String, Long>(2);
  result.put("attachmentId", responseHandler.getAttachmentId());
  result.put("contentId", responseHandler.getContentId());


 

Regards,

Thomas Setiabudi

Reply to this message by going to Community

Start a new discussion in jBPM at Community