[jbpm-users] [JBoss jBPM] - Re: Solution: JBPM3 and Spring Integration
mr_magoo
do-not-reply at jboss.com
Wed Aug 19 19:38:58 EDT 2009
The horribly ugly delegation node...
public class JbpmSpringDelegationNode implements DecisionHandler, ActionHandler, AssignmentHandler {
| private static final long serialVersionUID = 1L;
|
| private String beanName;
| protected static BeanFactory beanFactory;
| private Object bean;
|
| public String decide(ExecutionContext executionContext) throws Exception {
| DecisionHandler dh = getBean();
| return dh.decide(executionContext);
| }
| public void execute(ExecutionContext executionContext) throws Exception {
| ActionHandler ah = getBean();
| ah.execute(executionContext);
| }
| public void assign(Assignable assignable, ExecutionContext executionContext) throws Exception {
| AssignmentHandler ah = getBean();
| ah.assign(assignable, executionContext);
| }
| @SuppressWarnings("unchecked")
| private <T> T getBean() {
| if (bean == null) {
| bean = beanFactory.getBean(beanName);
| }
| return (T) bean;
| }
| public String getBeanName() {
| return beanName;
| }
| public void setBeanName(String beanName) {
| this.beanName = beanName;
| }
|
| }
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4250516#4250516
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4250516
More information about the jbpm-users
mailing list