[jboss-user] [jBPM Users] - command service
sravyts
do-not-reply at jboss.com
Mon Sep 14 09:08:08 EDT 2009
This might be a very easy question to solve , but I can't find the solution (or maybe I'm completely missing the ball here...)
I'm trying to create my own custom query (MyQuery which extends AbstractQuery).
Now is my problem: how can I execute this query?
I was thinking calling processEngine.execute(query) (since AbstractQuery implements the Command interface), but I can't succeed in getting a processEngine (I'm using spring integration)
If I autowire processengine I get the following error:
| Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [org.jbpm.api.ProcessEngine] is defined: expected single matching bean but found 2: [jbpmConfiguration, processEngine]
|
This is my spring configuration:
| <bean id="jbpmConfiguration" class="org.jbpm.pvm.internal.cfg.SpringConfiguration">
| <constructor-arg value="org/mypackage/jbpm.cfg.xml" />
| </bean>
|
| <bean id="processEngine" factory-bean="jbpmConfiguration" factory-method="buildProcessEngine" />
| <bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
| <bean id="executionService" factory-bean="processEngine" factory-method="getExecutionService" />
| <bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" />
| <bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />
| <bean id="identityService" factory-bean="processEngine" factory-method="getIdentityService" />
|
| <bean id="queryExecutor" class="org.mypackage.QueryExecutor" />
|
|
|
And QueryExecutor :
| public class QueryExecutor
| {
| @Autowired
| ProcessEngine processEngine
|
| public List query(MyQuery query){
| return processEngine.execute(query);
| }
| }
|
Is there another way for executing commands using spring integration?
Or aren't we supposed to execute commands?
Wkr,
Sofie
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4255093#4255093
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4255093
More information about the jboss-user
mailing list