[jboss-user] [jBPM] - Re: notifications with attachments
Thomas Setiabudi
do-not-reply at jboss.com
Fri Jan 4 05:42:42 EST 2013
Thomas Setiabudi [https://community.jboss.org/people/thomas.setiabudi] created the discussion
"Re: notifications with attachments"
To view the discussion, visit: https://community.jboss.org/message/787565#787565
--------------------------------------------------------------
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
[https://community.jboss.org/message/787565#787565]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20130104/1276dfc5/attachment.html
More information about the jboss-user
mailing list