[jboss-user] [jBPM] - jBPM 4.3 Spring bean as event listener

Peter Swartwout do-not-reply at jboss.com
Tue Mar 30 18:21:13 EDT 2010

Peter Swartwout [http://community.jboss.org/people/spincycle] created the discussion

"jBPM 4.3 Spring bean as event listener"

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

I have followed the recommendations in the developer's guide for doing Spring integration with jBPM 4.3. My application deploys to JBoss 5, and the server starts cleanly.

Here's my issue: I want my processes to be able to use Spring beans for event listeners. The relevant process code is:
> <process name="speechrec" ...>
>     <on event="start">
>         <event-listener expr="#{processListener}" >
>             <field name="eventType">
>                 <string value="start"/>
>             </field>
>         </event-listener>
>     </on>
The bean id "processListener" is defined in my Spring config, and the expression #{processListener} is evaluated to the correct class name, but the class is instantiated by jBPM instead of Spring. So the bean's Spring properties are not injected, so of course I get NPE's whenever they are used. I was hoping the "expr" attribute would behave like Spring's "ref" attribute and make use of an existing bean if there is one.

Is there any way to get what I want?  Does it mean that only jBPM beans can be used as event listeners?


Reply to this message by going to Community

Start a new discussion in jBPM at Community

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

More information about the jboss-user mailing list