[jboss-user] [jBPM Development] - Mail template for custom MailProducer

Kevin Moodley do-not-reply at jboss.com
Mon Apr 19 01:08:26 EDT 2010


Kevin Moodley [http://community.jboss.org/people/kevinmoodley] created the discussion

"Mail template for custom MailProducer"

To view the discussion, visit: http://community.jboss.org/message/538195#538195

--------------------------------------------------------------
How do I get the mail template from the jpdl set on my custom MailProducer?
This is what I have so far:

public class CustomMailProducer extends MailProducerImpl {
..
    public Collection<Message> produce(Execution execution) {
     MailTemplate template = super.getTemplate();
     ...
    }

In the JPDL I have :

<task assignee="kmoodley" g="210,250,92,52" name="User Review">
        <description>User Review Task Description</description>
        <notification  class="com.kevinmoodley.bpm.mail.CustomMailProducer" template="test-template"/>
        </notification>
        <transition g="-42,-18" name="CANCEL" to="end1"/>
        <transition g="-42,-18" name="RESTART" to="end2"/>
</task>

Here is the jbpm.mail.templates.xml

<?xml version="1.0" encoding="UTF-8"?>
<jbpm-configuration>
  <process-engine-context>
     <mail-template name="test_template">
          <to addresses=" mailto:kevinmoodley at gmail.com kevinmoodley at gmail.com" />
          <subject>Test Email via Notification</subject>
          <text>
                This is a test email sent by the notification tag in a Human Task              
          </text>
     </mail-template>  
  </process-engine-context>
</jbpm-configuration>


But super.getTemplate() always returns null.
Note: same jbpm.mail.templates.xml works fine when the custom MailProducer is not used.

What else do I need to do to get this CustomMailProducer to pick up the template?

Thanks
Kevin

--------------------------------------------------------------

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

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100419/943cc3d2/attachment.html 


More information about the jboss-user mailing list