ServiceTask after usertask ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2011 10:24 AM
<?xml version="1.0" encoding="UTF-8"?><definitions> <process name="Order_model" id="Order_model"> <startEvent id="startOrder" name=""/> <serviceTask id="INITIATE_ORDER" name="Initiate the order" activiti:expression="#{orderServiceImpl.initiateOrder(execution)}" /> <userTask id="provisionOrder" name="Validate and provision the order" activiti:formKey="approve.form"> <documentation> This form will be used to manually approve the orders. </documentation> <potentialOwner> <resourceAssignmentExpression> <formalExpression>management</formalExpression> </resourceAssignmentExpression> </potentialOwner> </userTask> <endEvent id="endOrderEvent" name=""/><serviceTask id="PLACE_ORDER" name="Place and persist the order" activiti:expression="#{orderServiceImpl.placeOrder(execution)}" /> <sequenceFlow id="SequenceFlow" name="" sourceRef="startOrder" targetRef="INITIATE_ORDER"/> <sequenceFlow id="SequenceFlow_1" name="" sourceRef="INITIATE_ORDER" targetRef="provisionOrder"/> <sequenceFlow id="SequenceFlow_2" name="" sourceRef="provisionOrder" targetRef="PLACE_ORDER"/> <sequenceFlow id="SequenceFlow_3" name="" sourceRef="PLACE_ORDER" targetRef="endOrderEvent"/> </process></definitions>
The first servicetask runs without a problem.
I can open the taskform in the activiti explorer. But when I hit the OK button in the form I get the exception:
Caused by: org.activiti.engine.impl.javax.el.PropertyNotFoundException: Cannot resolve identifier 'orderServiceImpl'
at org.activiti.engine.impl.juel.AstIdentifier.eval(AstIdentifier.java:83)
at org.activiti.engine.impl.juel.AstMethod.invoke(AstMethod.java:79)
at org.activiti.engine.impl.juel.AstMethod.eval(AstMethod.java:75)
at org.activiti.engine.impl.juel.AstEval.eval(AstEval.java:50)
at org.activiti.engine.impl.juel.AstNode.getValue(AstNode.java:26)
at org.activiti.engine.impl.juel.TreeValueExpression.getValue(TreeValueExpression.java:114)
at org.activiti.engine.impl.el.JuelExpression.getValue(JuelExpression.java:44)
… 36 more
Seems like activiti tries to resolve the xml line:
<serviceTask id="PLACE_ORDER" name="Place and persist the order" activiti:expression="#{orderServiceImpl.placeOrder(execution)}" />
as a field submitted from the form.The method and class exist. Even when I use the same xml as the first serviceTask I still get the same error.
My intention is just to execute the method placeOrder in the class OrderServiceImpl after I hit the 'OK' button in the activiti form.
Any ideas ?
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2011 03:54 AM
<sequenceFlow id="SequenceFlow_2" name="" sourceRef="provisionOrder" targetRef="endOrderEvent"/>
So activiti (5.0) seems to have problems by calling a servicetask after a usertask ? Is this a bug ? Or should I configure some other properties ?
Tom.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2011 03:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2011 04:10 AM
Calling a service-task after a user-task works, that's not the problem. Seems like the spring-beans can't be resolved. Can you post your spring-configuration, where you configure the engine in? Looks like the annotated classes aren't picked up by the application-context.
Cheers,
Frederik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2011 02:42 AM
Bean resolution works but only if I use them before the <userTask/>
Here is the content of my spring files:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="file:/appl/webservers/apache-tomcat-7.0.6/conf/platform.properties" />
</bean>
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
<property name="databaseType" value="oracle" />
<property name="dataSource" ref="myDataSource" />
<property name="transactionManager" ref="myTxManager"/>
<property name="databaseSchemaUpdate" value="false" />
<property name="jobExecutorActivate" value="${activiti.jobexecutor}" />
<property name="deploymentResources">
<list>
<value>classpath*:be/xxx/poc/*.bpmn20.xml</value>
<value>classpath*:be/xxx/poc/taskform/*.form</value>
</list>
</property>
<property name="history" value="full" />
</bean>
<bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
<property name="processEngineConfiguration" ref="processEngineConfiguration" />
</bean>
<bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
<bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService" />
<bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />
<bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" />
<bean id="managementService" factory-bean="processEngine" factory-method="getManagementService" />
</beans>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">
<context:component-scan base-package="be.scarlet.poc.bpm" />
<context:component-scan base-package="be.scarlet.poc.controller" />
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
<property name="prefix" value="/WEB-INF/jsp/"/>
<property name="suffix" value=".jsp"/>
</bean>
</beans>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns
xm="http://www.springframework.org/schema/oxm"
xmlns:sws="http://www.springframework.org/schema/web-services"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util" xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/oxm http://www.springframework.org/schema/oxm/spring-oxm-1.5.xsd
http://www.springframework.org/schema/web-services http://www.springframework.org/schema/web-services/web-services-1.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://www.springframework.org/schema/oxm http://www.springframework.org/schema/oxm/spring-oxm-1.5.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
<!– Scans the classpath of this application for @Components to deploy as beans –>
<context:component-scan base-package="be.xxx.poc.controller"/>
<!– Configures the @Controller programming model –>
<mvc:annotation-driven/>
</beans>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2011 03:12 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2011 11:01 AM
An example was provided in http://jira.codehaus.org/browse/ACT-636.
Via JUnit the test is successful; however when completing a UserTask via the explorer the serviceTaks bean can not be resolved.
Kind Regards,
Tom

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2011 11:50 AM
Is it so, that you have 2 separate webapps - one activiti-rest included in distro, and second one - oss-bss-workflow?
If so, than this will not work. Because than you have 2 engines, sharing one DB. Only one (embedded in oss-bss-workflow) can access orderService. The one used when form is submitted by explorer uses only activiti default spring config, so it cannot access spring config deployed in oss-bss-workflow.
Again, I don't know if this is the case, but I cannot see any other reason - as unit test work, you say. And if this is the case, then one possibility would be to embed activiti-rest webapp in your webapp, so that only one engine is used
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2011 02:11 PM
If you are using the explorer, the process-engine is obtained through ProcessEngines.getProcessEngine(…). The configuration (activiti.cfg.xml) is only used to fetch the ProcessEngine bean itself.
Are your spring-services you want to use, declared in the same XML file as the ProcessEngineFactoryBean?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2012 11:00 AM
I am struggling with the same problem, see http://forums.activiti.org/en/viewtopic.php?f=6&t=4175
Is there any solution?
Best regards,
Andi
