[jbpm-dev] [Design of JBoss jBPM] - Re: Mail session configuration

bradsdavis do-not-reply at jboss.com
Thu Apr 9 10:51:42 EDT 2009


Actually instead of extending a specific mail producer, what if the templating did this:


  | <template name="exampleTemplate">
  |     <mail-producer class="org.jbpm.pvm.internal.email.producer.impl.ScriptMailProducer">
  |         <subject>Example subject.</subject>
  |         <body>This is an example.</body>
  |         <language>JUEL</language> //or whatever
  |     <mail-producer>
  | </template>
  | 

And then the templated mail producer itself could be plugable.

So within the templated mail producer we would have something like...

  | public class TemplateMailProducer implements MailProducer {
  | 
  | 	protected String templateName;
  | 	
  | 	public Collection<Email> produce(Execution exe, MailContext mailContext) throws Exception {
  | 		//Find out which producer is being used in the template.
  | 		MailProducer templatedProducer = readTemplate(templateName);
  | 		
  | 		return templatedProducer.produce(exe, mailContext);
  | 	}
  | 
  | 	protected MailProducer readTemplate(String templateName)
  | 	{
  | 		return null; //Actually do the reading and create the appropriate producer.
  | 	}
  | }
  | 
  | 

The nice thing about this solution is that we could reuse the mail-producer reader since it will be basically the same thing as if it were defined in the JPDL itself.

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4224728#4224728

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4224728



More information about the jbpm-dev mailing list