[jboss-user] [jBPM] - I18n : create mail with ressource bundles ?

Mark Roy do-not-reply at jboss.com
Tue May 11 11:27:33 EDT 2010


Mark Roy [http://community.jboss.org/people/markroy] replied to the discussion

"I18n : create mail with ressource bundles ?"

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

--------------------------------------------------------------
I've given this some thought myself, but haven't implemented anything yet. There's nothing available "out of the box", but I believe it can be done on your own. I guess the solution depends on what your requirement is.

If you only need to internationalize per jBPM installation, use the mail template feature. Move all mail message text out of the jPDL and into a separate mail template file (which essentially would be a resource file), then import the resource ( <import resource=+"mailtext.jbpm.cfg.xml" /> )+ in jbpm.cfg.xml. Deploy the appropriate mail template file during app installation.

If you need to internationalize per process instance, you could create a process variable(s) to hold the appropriate text for that instance. Then, use process variable references in your mail templates rather than hard-coded text. The variables have to be serializable, so something based on ResourceBundle won't work unless you do something extra.

The jBPM JuelScriptEngine seems like it wll resolve resource variables: chain.add( *new* *ResourceBundleELResolver());,* but I don't know what those references would look like or how to load the bundle. Perhaps someone else can shed some light?

Finally, if you need to internationalize mail text based on the locale of the recipient(s), it looks like you'd have to create your own MailProducer, which is a supported extension point. You'd probably have to create your own IdentitySession implementation, since locale is not included in the default implementation.

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

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

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100511/9db9c795/attachment.html 


More information about the jboss-user mailing list