Discussion:
[jboss-user] [jBPM] - notifications with attachments
jnorris
2013-01-03 19:41:07 UTC
Permalink
jnorris [https://community.jboss.org/people/jnorris] created the discussion

"notifications with attachments"

To view the discussion, visit: https://community.jboss.org/message/787404#787404

--------------------------------------------------------------
I have a use case where I want to add an attachment to a user task, complete the task and then send an email with the attachment.  Does anyone have a solution for this?  I looked at the EmailWorkItemHandler and there is no support for attachments. 

Also in another use case how would an attachment for one user task get passed to another user task?

Thanks,
Jim
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/787404#787404]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
jnorris
2013-01-03 20:30:34 UTC
Permalink
jnorris [https://community.jboss.org/people/jnorris] created the discussion

"Re: notifications with attachments"

To view the discussion, visit: https://community.jboss.org/message/787416#787416

--------------------------------------------------------------
I see from this previous post:  https://community.jboss.org/thread/205775 https://community.jboss.org/thread/205775 that attachments for email are not supported.  Does anyone have a custom solution they could share?

Regards,
Jim
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/787416#787416]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Thomas Setiabudi
2013-01-04 10:42:42 UTC
Permalink
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]
jnorris
2013-01-04 12:17:53 UTC
Permalink
jnorris [https://community.jboss.org/people/jnorris] created the discussion

"Re: notifications with attachments"

To view the discussion, visit: https://community.jboss.org/message/787582#787582

--------------------------------------------------------------
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
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/787582#787582]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Loading...