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

Alejandro Guizar do-not-reply at jboss.com
Tue Apr 20 21:13:18 EDT 2010


Alejandro Guizar [http://community.jboss.org/people/alex.guizar%40jboss.com] replied to the discussion

"Mail template for custom MailProducer"

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

--------------------------------------------------------------
Here is how you can specify a named template for a custom mail producer:
<mail name='send mail' class='org.example.CustomMailProducer'>
  <field name='templateName'><string value='rectify-template'/></field>
  <transition to='end' />
</mail>

Here is the custom mail producer code:
public class CustomMailProducer extends MailProducerImpl {
 
  private String templateName;
 
  public Collection<Message> produce(Execution execution) {
    MailTemplateRegistry templateRegistry = EnvironmentImpl
      .getFromCurrent(MailTemplateRegistry.class);
    setTemplate(templateRegistry.getTemplate(templateName));
    return super.produce(execution);
  }
}

It should be possible to inject a reference to the template registry into the bean, but it is not currently possible due to the way the custom mail producer is parsed. I will fix this in  https://jira.jboss.org/jira/browse/JBPM-2844 JBPM-2844.

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

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

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/20100420/c01559ab/attachment.html 


More information about the jboss-user mailing list