-
1. Re: Jbpm 5 - call to spring beans
malabalu Feb 21, 2012 11:37 AM (in response to malabalu)We need to make a call to Spring Beans from the jbpm process .
Is there anyway we can configure this without having a class to lookup the beans in spring context?
-
2. Re: Jbpm 5 - call to spring beans
eaa Feb 21, 2012 11:45 AM (in response to malabalu)AFAIK, there is no native integration bewteen jbpm5 and spring beans. I wouldn't be that hard to create your own generic WIHandler to do this though.
Best Regards,
-
3. Re: Jbpm 5 - call to spring beans
malabalu Feb 21, 2012 1:11 PM (in response to eaa)Thanks Esteban for your reply. As I originally mentioned in my post, I have read that in jbpm4, it is possible to call the spring beans from the process.
http://www.inze.be/andries/2009/06/28/documentation-spring-jbpm-integration/
Please look under configuration.I am new to jbpm and did not understand the whole configuration in the above one . May be it is something that was possible in jbpm4 but not in jbpm5.
Also currently in our jbpm3 project, we are using a singleton class to look up beans in Spring context .I have pasted some of the code snippets .Since this has the hard coding of the bean names in the codebase, we want to see if there are other ways.
ServiceInstance serviceInstance = ServiceInstance.getInstance();
where ServiceInstance is a class that implements implements org.springframework.context.ApplicationContextAware and has a property of
org.springframework.context.ApplicationContext ...so the getBean will lookup the beans with name and return them.
public class ServiceInstance implements
ApplicationContextAware {
private static ServiceInstance staticServiceInstance = newServiceInstance();
private static ApplicationContext ac;
public static
ServiceInstance getInstance() {
return staticServiceInstance
;
}
@Override
setApplicationContext(ApplicationContext applicationContext)
throws
BeansException {
if (ac == null) {
ac
ac = applicationContext;
}
}
public Object getBean(String beanId) {
return ac.getBean(beanId);
}
-
4. Re: Jbpm 5 - call to spring beans
eaa Feb 21, 2012 1:29 PM (in response to malabalu)1 of 1 people found this helpfuljbpm5 comes from a different code-base than jbpm3 and jbpm4. That is why some of the characteristics found there are not (yet) present in version 5. I would recommend you to read the documentation available about Task Nodes in BPMN2 and the concept of WorkItem and WorkItemHandler in jbpm5.
Best Regards,
-
5. Re: Jbpm 5 - call to spring beans
malabalu Feb 21, 2012 4:08 PM (in response to eaa)Thanks agian Esteban.I iwll read those.