This content has been marked as final.
Show 4 replies
-
1. Re: E-mail attachments
rebody Aug 6, 2010 3:09 AM (in response to krixerx)Hi Erki,
You could get attachment data from process variable. Like this:
<attachment name='strip.gif' expression='${strip}' mime-type='image/gif'/>
Please refer the testcase in svn.
-
2. Re: E-mail attachments
krixerx Aug 6, 2010 3:18 AM (in response to rebody)Hi!
Sometimes i need to add one attachment, sometimes 5 attachments. Is it possible to add attachments dynamically in jPDL (to use "decision" or "foreach" operation under "attachments" element)?
-
3. Re: E-mail attachments
rebody Aug 6, 2010 3:53 AM (in response to krixerx)Hi Erki,
If you want to achieve dynamic attachments when sending mails. I sugguest you create a custom mailProducer, Please refer here:
http://docs.jboss.com/jbpm/v4/devguide/html_single/#custommailproducers
-
4. Re: E-mail attachments
krixerx Aug 6, 2010 4:19 AM (in response to rebody)I found easy solution. It's not nice but it works.
i - number of attachments.
<decision name="sendEmailDecision"><transition to="sendEmailWith1Attachment"><condition expr="#{i == 1}"/></transition><transition to="sendEmailWith2Attachments"><condition expr="#{i == 2}"/></transition><transition to="sendEmailWith3Attachments"><condition expr="#{i == 3}"/></transition><transition to="end"/></decision><mail name="sendEmailWith1Attachment">...<attachments><attachment file="#{attachmentAddresses.get(0)}" mime-type="txt/xml" name="#{attachmentNames.get(0)}"/></attachments><transition to="end"/></mail><mail name="sendEmailWith2Attachments">...<attachments><attachment file="#{attachmentAddresses.get(0)}" mime-type="txt/xml" name="#{attachmentNames.get(0)}"/><attachment file="#{attachmentAddresses.get(1)}" mime-type="txt/xml" name="#{attachmentNames.get(1)}"/></attachments><transition to="end"/></mail><mail name="sendEmailWith3Attachments">...<attachments><attachment file="#{attachmentAddresses.get(0)}" mime-type="txt/xml" name="#{attachmentNames.get(0)}"/><attachment file="#{attachmentAddresses.get(1)}" mime-type="txt/xml" name="#{attachmentNames.get(1)}"/><attachment file="#{attachmentAddresses.get(2)}" mime-type="txt/xml" name="#{attachmentNames.get(2)}"/></attachments><transition to="end"/></mail>