This content has been marked as final.
Show 3 replies
-
1. Re: notifications with attachments
jnorris Jan 3, 2013 3:30 PM (in response to jnorris)I see from this previous post: https://community.jboss.org/thread/205775 that attachments for email are not supported. Does anyone have a custom solution they could share?
Regards,
Jim
-
2. Re: notifications with attachments
thomas.setiabudi Jan 4, 2013 5:43 AM (in response to jnorris)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());
If you use persistence, you will be able to see the attached file in Attachment table
Regards,
Thomas Setiabudi
-
3. Re: notifications with attachments
jnorris Jan 4, 2013 7:17 AM (in response to thomas.setiabudi)Thanks for the reply Thomas. Is the result map you show the content data in the task complete method? How would the id's be used with the jbpm api to have the attachment passed to the next task in a chain of tasks? We are using persistence but have no direct access to the tables at this point.
Regards,
Jim