Community

Mail template for custom MailProducer

created by Kevin Moodley in jBPM Development - View the full discussion

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="kevinmoodley@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

Start a new discussion in jBPM Development at Community