[jbpm-dev] [Design of JBoss jBPM] - Re: jBPM 4 Emails Sync vs Async

tom.baeyens@jboss.com do-not-reply at jboss.com
Tue Apr 7 09:43:21 EDT 2009


"bradsdavis" wrote : OK.  I think I have a solution to this.
  | 
  | Both the synchronous and asynchronous emailer will implement the same interface, so they will be interchangeable.  The asynchronous will use the synchronous emailler under the hood, it will just be called by the job executor.

Close.  I discussed with Alejandro yesterday:

we need a MailSession interface for that.  mail session would look something like this

interface MailSession {
  |   Mail createMail();
  | }
  | 
  | interface Mail {
  |   Mail setTo(String to);
  |   Mail setCC(String cc);
  |   Mail setBCC(String bcc);
  |   Mail setSubject(String subject);
  |   Mail setBody(String subject);
  |   Mail addAttachment(String name, InputStream attachment, String mimeType);
  |   
  |   void send(boolean sendAsync);
  | }

we thought it was easiest to develop something like the interface shown above.

Activies can get a MailSession from the current environment.  But we don't need 2 different implementations.  

Clients of this code (Activities) would need to determine if sending needs to be done asynchronous or not.  this should eventually be based on a global process engine configuration that specifies the default and jpdl attributes that allow to overwrite this default.

Does this match with your expectations, Brad ?

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

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



More information about the jbpm-dev mailing list