[jboss-user] [jBPM] New message: "Re: jbpm 4.3 spring & DecisionHandler question"
Santanu Saraswati
do-not-reply at jboss.com
Sat Jan 30 10:37:15 EST 2010
User development,
A new message was posted in the thread "jbpm 4.3 spring & DecisionHandler question":
http://community.jboss.org/message/523136#523136
Author : Santanu Saraswati
Profile : http://community.jboss.org/people/saraswati.santanu
Message:
--------------------------------------------------------------
Unforunately there is no clean way of doing this. You can however use some workaround.
If you remember that good old ServiceLocator J2EE pattern, you can code something similar to locate your spring beans. You can have a class like this:
*
*
*import javax.annotation.Resource;*
*import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;*
*/**
* @author Santanu
*
*/
@Component("serviceLocator")
public class ServiceLocator {
private static ApplicationContext applicationContext;
@Resource
public void setAplicationContext(ApplicationContext applicationContext) {
ServiceLocator.applicationContext = applicationContext;
}
public static Object getService(String beanName) {
return applicationContext.getBean(beanName);
}
}*
Now in your decision handler can make use of this like this:
**
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/523136#523136
More information about the jboss-user
mailing list