JBoss Community

Re: new work item definition: email connection

created by Tihomir Surdilovic in jBPM - View the full discussion

Hi Renzo, in the video you mentioned we are using the jBPM installer as described in docs http://docs.jboss.org/jbpm/v5.1/userguide/ch03.html.

As also described in docs (http://docs.jboss.org/jbpm/v5.1/userguide/ch13.html) each workitem needs to have a workitem handler class which gets to do the actual work and is delegated to by the process engine.

So the only "trick" that was not shown in the video was the configuration of the Email workitem handler which happens in

$jbpm-installer-dir/conf/META-INF

there you will see a CustomWorkItemHandlers.conf file which you need to edit and add the workitem handler class for the Email workitem, for example:

 

[

  "Log": new org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler(),

  "Email": new org.jbpm.process.workitem.email.EmailWorkItemHandler("MySMTPHost","MySMTPPort","MyUsername","MyPassword"),

]

 

Since org.jbpm.process.workitem.email.EmailWorkItemHandler is already available in the distro and is on the classpath at runtime, you do not need to write any code. For other workitem handlers, you would need to add the configuration in CustomWorkItemHandlers.conf as well as place a jar with your handler impl class(es) on the classpath so they can be found.

After any changes to $jbpm-installer-dir/conf/META-INF/CustomWorkItemHandler.conf you need to run in $jbpm_console_dir:

ant clean.demo

ant install.demo

ant start.demo

so that your configuration changes get copied to the right locations.

 

Hope this helps.

Reply to this message by going to Community

Start a new discussion in jBPM at Community