jBPM mail nodes are simple nodes designed only to send mails. This time you don’t have to implement any handler or function, jBPM libraries provide nearly all you need.
In mail info tab you can set the destination e-mail address, the subject and the mail body that is going to send. This will be useful when you know destination e-mail address, orders@mycompany.com, for instance.
If you need to send mails to workflow actors, you can set a user variable in context:
executionContext.setVariable("user", workflowActor);
and configure mail info as it follows:
jBPM address resolver will check for user e-mail address from database and send him the mail, you will have to do nothing!
This is a great node but I had some requirements that it didn’t provide to me, so I re-implemented it, adding some new methods.
You can download new implementation here.
Now I can send mails using a gmail account. To explain it in a simple way, my implementation read some extra parameters from jbpm.cfg.xml file before sending the mail.
<string name="jbpm.mail.smtp.host" value="smtp.gmail.com" /> <bean name="jbpm.mail.address.resolver" class="org.jbpm.identity.mail.IdentityAddressResolver" singleton="true" /> <string name="jbpm.mail.from.address" value="yourMail@gmail.com" /> <string name="jbpm.mail.user" value="yourUser@gmail.com" /> <string name="jbpm.mail.pass" value="yourPassword" /> <string name="jbpm.mail.port" value="465" /> <string name="jbpm.mail.smtp.socketFactory.port" value="465" /> <string name="jbpm.mail.smtp.socketFactory.class" value="javax.net.ssl.SSLSocketFactory" /> <string name="jbpm.mail.smtp.auth" value="true" /> <string name="jbpm.mail.smtp.starttls.enable" value="true" /> <string name="jbpm.mail.debug" value="true" /> <string name="jbpm.mail.smtp.socketFactory.fallback" value="false" /> <string name="jbpm.mail.advanced.config" value="true" /> <string name='mail.class.name' value='FastSign.mail.Mail' />
If jbpm.mail.advanced.config is set to false it works as the original mail node. Setting it to true, activates the extra parameters. In this case, 465 is gmail port, I suppose you can change it to use other system. Note that you have to define mail.class.name with the correct package.
I hope this will be useful.












Recent Comments