[JBoss jBPM] - [jBPM4] Task still in Active Activies after being completed
by freiburger
Hi,
I've encountered a problem when evaluating the task activity of jBPM4. Unfortunately the forum search is down at the moment, but I haven't found any posts regarding that issue when searching manually ;)
Configuration:
- jBPM4.0 standalone out of the box, only changed DB to MySQL5
- JDK/Container: Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
Process definition:
| <?xml version="1.0" encoding="UTF-8"?>
|
| <process name="tasktest" xmlns="http://jbpm.org/4.0/jpdl">
| <start name="start" g="77,110,48,48">
| <transition name="to task" to="task" g="-36,-20" />
| </start>
| <task assignee="freiburger" name="task" g="206,127,92,52">
| <transition name="to wait" to="wait" g="-36,-20" />
| </task>
| <state name="wait" g="401,154,92,52">
| <transition name="to end" to="end" g="-41,-20" />
| </state>
| <end name="end" g="543,121,48,48" />
| </process>
|
API using JbpmTestCase:
| public void testTakeTask() {
| /* Create process instance */
| ProcessInstance processInstance = executionService
| .startProcessInstanceByKey("tasktest");
|
| /* Find tasks for freiburger (1 expected) */
| List<Task> taskList = taskService.findPersonalTasks("freiburger");
| assertEquals(1, taskList.size());
| Task task = taskList.get(0);
| assertEquals("task", task.getName());
| assertEquals("freiburger", task.getAssignee());
|
| /* Complete task */
| taskService.completeTask(task.getId());
|
| /* Find tasks for freiburger (0 expected) */
| taskList = taskService.findPersonalTasks("freiburger");
| assertEquals(0, taskList.size());
|
| /* Find active activities ("wait" expected) */
| Set<String> expectedActivityNames = new HashSet<String>();
| expectedActivityNames.add("wait");
| assertEquals(expectedActivityNames, processInstance
| .findActiveActivityNames());
| }
|
Log
| 18:30:27,357 FIN | [ProcessDefinitionImpl] creating new execution for process 'tasktest'
| 18:30:27,365 FIN | [DefaultIdGenerator] generated execution id tasktest.1
| 18:30:27,372 FIN | [ExecuteActivity] executing activity(start)
| 18:30:27,372 FIN | [ExecuteActivity] executing activity(task)
| 18:30:27,459 FIN | [TaskQueryImpl] select task from org.jbpm.pvm.internal.task.TaskImpl as task where task.assignee = :assignee order by task.priority desc
| 18:30:27,467 FIN | [TaskQueryImpl] setting parameter assignee: freiburger
| 18:30:27,518 FIN | [Signal] signalling activity(task), signalName=completed
| 18:30:27,527 FIN | [ExecuteActivity] executing activity(wait)
| 18:30:27,559 FIN | [TaskQueryImpl] select task from org.jbpm.pvm.internal.task.TaskImpl as task where task.assignee = :assignee order by task.priority desc
| 18:30:27,559 FIN | [TaskQueryImpl] setting parameter assignee: freiburger
| 18:30:27,561 SEV | [BaseJbpmTestCase]
| ### EXCEPTION ###########################################
| 18:30:27,561 SEV | [BaseJbpmTestCase] ASSERTION FAILURE: expected:<[wait]> but was:<[task]>
| junit.framework.AssertionFailedError: expected:<[wait]> but was:<[task]>
| at junit.framework.Assert.fail(Assert.java:47)
| at junit.framework.Assert.failNotEquals(Assert.java:282)
| at junit.framework.Assert.assertEquals(Assert.java:64)
| at junit.framework.Assert.assertEquals(Assert.java:71)
| at testing.TakeTaskTest.testTakeTask(TakeTaskTest.java:49)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at junit.framework.TestCase.runTest(TestCase.java:154)
| at org.jbpm.test.BaseJbpmTestCase.runTest(BaseJbpmTestCase.java:80)
| at junit.framework.TestCase.runBare(TestCase.java:127)
| at junit.framework.TestResult$1.protect(TestResult.java:106)
| at junit.framework.TestResult.runProtected(TestResult.java:124)
| at junit.framework.TestResult.run(TestResult.java:109)
| at junit.framework.TestCase.run(TestCase.java:118)
| at junit.framework.TestSuite.runTest(TestSuite.java:208)
| at junit.framework.TestSuite.run(TestSuite.java:203)
| at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
| at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
| ### EXCEPTION ###########################################
| 18:30:27,562 SEV | [BaseJbpmTestCase]
| 18:30:27,607 FIN | [DbSessionImpl] deleting history process instance tasktest.1
| 18:30:27,640 FIN | [DbSessionImpl] deleting process instance tasktest.1
| 18:30:27,654 FIN | [DeleteDeploymentCmd] deleting deployment 1
| 18:30:27,706 FIN | [BaseJbpmTestCase] === ending testTakeTask =============================
|
Problem description
So obviously the task was not removed from the current activities after completion. Still the engine moves on to the next activity, but it doesn't show up in the activity list at all. I quite don't understand this behaviour if it is intended, any help is greatly appreciated.
Thanks!
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4248197#4248197
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4248197
16 years, 8 months
[JBoss jBPM] - What all the required Mbenas for jBPM 3.1.3
by contactnagesh
Hi,
I have downloaded Jboss 4.0.5 GA version from the jboss site and downloaded jBPM 3.1.3, trying to integrate with Jboss 4.0.5 GA. I have made that to work by removing the dom4j.jar file and script changes.
Now we have stripped version of Jboss 4.0.5, deploying jBPM 3.1.3. I am hitting the below Eorror
2009-08-04 10:29:37,775 ERROR [org.jboss.deployment.scanner.URLDeploymentScanner] (main) Incomplete Deployment listing:
â MBeans waiting for other MBeans â
ObjectName: jboss.jdbc:service=metadata,datasource=DefaultDS
State: CONFIGURED
I Depend On:
jboss.jdbc:service=metadata
â MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM â
ObjectName: jboss.jdbc:service=metadata
State: NOTYETINSTALLED
Depends On Me:
jboss.jdbc:service=metadata,datasource=DefaultDS
Can any one Help me, why this error was hitting? what all the required MBenas for the jBPM 3.1.3 to work.
Thanks,
Nag
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4248196#4248196
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4248196
16 years, 8 months
[JBoss jBPM] - Re: Integration problem of jBPM 4, Spring and Hibernate
by KeithWong123
I follow exactly as JBPM Developers Guide session "16.3 Usage" to setup related XML. However, still cannot find the Spring Bean (my case is "TestCon" ).
The following are the XML and result.
***process.jpdl.xml(JBPM flow definition)***
<?xml version="1.0" encoding="UTF-8"?>
|
| <process name="process" xmlns="http://jbpm.org/4.0/jpdl">
|
| <start g="29,189,48,48" name="start">
| <transition g="-74,-18" name="to doSomeThing" to="doSomeThing"/>
| </start>
|
| <java expr="#{TestCon}" method="createProduct" name="doSomeThing" g="178,89,80,40">
| <transition to="printSomeThing"/>
| </java>
|
| <state g="383,196,111,52" name="printSomeThing">
| <transition g="-23,-20" name="to end" to="end"/>
| </state>
|
| <end g="563,199,48,48" name="end"/>
|
| </process>
|
|
******ApplicationContent-test.xml**********
| <?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:aop="http://www.springframework.org/schema/aop"
| xmlns:tx="http://www.springframework.org/schema/tx"
| xsi:schemaLocation="http://www.springframework.org/schema/beans
| http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
| http://www.springframework.org/schema/tx
| http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
| http://www.springframework.org/schema/aop
| http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
|
| <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
| <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
| <property name="url" value="jdbc:mysql://localhost:3306/ig_loading"/>
| <property name="username" value="root"/>
| <property name="password" value="admin123"/>
| </bean>
|
| <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
| <property name="dataSource">
| <ref bean="dataSource"/>
| </property>
| <property name="configLocation">
| <value>classpath:hibernate.cfg.xml</value>
| </property>
| </bean>
|
| <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
| <property name="sessionFactory" ref="sessionFactory"/>
| </bean>
|
| <bean id="dbDAO" class="Dao.ProductDAO">
| <property name="sessionFactory" ref="sessionFactory"/>
| </bean>
|
| <bean id="productMan" class="Service.ProductManager">
| <property name="productDAO" ref="dbDAO"/>
| </bean>
|
| <bean id="TestCont" class="Test">
| <property name="managerProduct" ref="productMan"/>
| </bean>
|
| <bean id="jbpmConfiguration" class="org.jbpm.pvm.internal.cfg.SpringConfiguration">
| <constructor-arg value="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" />
|
| </beans>
|
*****Testing programe ****
| import org.jbpm.api.Configuration;
| import org.jbpm.api.ExecutionService;
| import org.jbpm.api.HistoryService;
| import org.jbpm.api.ManagementService;
| import org.jbpm.api.NewDeployment;
| import org.jbpm.api.ProcessEngine;
| import org.jbpm.api.ProcessInstance;
| import org.jbpm.api.RepositoryService;
| import org.jbpm.api.TaskService;
| import org.jbpm.pvm.internal.env.Environment;
| import org.jbpm.pvm.internal.env.SpringContext;
| import org.springframework.beans.BeansException;
| import org.springframework.context.ApplicationContext;
| import org.springframework.context.support.ClassPathXmlApplicationContext;
| import org.springframework.stereotype.Controller;
|
| import POJO.Product;
| import Service.ProductManager;
| @Controller
| public class Test{
| //implements ApplicationContextAware
| private ProductManager managerProduct;
| private static ApplicationContext ac =null;
|
| public static void main(String args[]){
| ac = new ClassPathXmlApplicationContext(new String[] {"applicationContext-test.xml"});
| Test test = new Test();
| test.startUpJBPM();
| }
|
| public void startUpJBPM(){
| ProcessEngine processEngine = new Configuration().buildProcessEngine();
| RepositoryService repositoryService = processEngine.getRepositoryService();
| ExecutionService executionService = processEngine.getExecutionService();
| TaskService taskService = processEngine.getTaskService();
| HistoryService historyService = processEngine.getHistoryService();
| ManagementService managementService = processEngine.getManagementService();
| NewDeployment nd = repositoryService.createDeployment();
| nd.addResourceFromClasspath("jpdl/process.jpdl.xml").deploy();
| ProcessInstance processInstance = executionService.startProcessInstanceByKey("process");
| }
|
| public void createProduct(){
| System.out.println("==== createProduct===");
| managerProduct= (ProductManager) ac.getBean("productMan");
| Product p = new Product();
| p.setSku("0605");
| p.setQuantity(04);
| p.setSupplierCode("0605");
| p.setIsMain(0);
| managerProduct.addProduct(p);
| }
| public ProductManager getManagerProduct() {
| return managerProduct;
| }
|
| public void setManagerProduct(ProductManager managerProduct) {
| this.managerProduct = managerProduct;
| }
|
| }
|
**** running result ****
| 19:21:31,046 INFO SettingsFactory:296 - Default entity-mode: pojo
| 19:21:31,046 INFO SessionFactoryImpl:161 - building session factory
| 19:21:31,531 INFO SessionFactoryObjectFactory:82 - Not binding factory to JNDI, no JNDI name configured
| 19:21:34,343 INFO DefaultCommandService:52 - exception while executing command org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd@181c4eb
| org.jbpm.api.JbpmException: script evaluation error: Cannot find property TestCon
| at org.jbpm.pvm.internal.script.ScriptManager.evaluate(ScriptManager.java:118)
| at org.jbpm.pvm.internal.script.ScriptManager.evaluate(ScriptManager.java:106)
| at org.jbpm.pvm.internal.script.ScriptManager.evaluateExpression(ScriptManager.java:78)
| at org.jbpm.jpdl.internal.activity.JavaActivity.perform(JavaActivity.java:68)
| at org.jbpm.jpdl.internal.activity.JpdlAutomaticActivity.execute(JpdlAutomaticActivity.java:15)
| at org.jbpm.pvm.internal.model.op.ExecuteActivity.perform(ExecuteActivity.java:60)
| at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:637)
| at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperation(ExecutionImpl.java:597)
| at org.jbpm.pvm.internal.model.ExecutionImpl.start(ExecutionImpl.java:201)
| at org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd.execute(StartProcessInstanceInLatestCmd.java:64)
| at org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd.execute(StartProcessInstanceInLatestCmd.java:37)
| at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
| at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:54)
| at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:54)
| at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
| at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.startProcessInstanceByKey(ExecutionServiceImpl.java:66)
| at Test.startUpJBPM(Test.java:40)
| at Test.main(Test.java:28)
| Caused by: javax.script.ScriptException: Cannot find property TestCon
| at org.jbpm.pvm.internal.script.JuelScriptEngine.evalExpr(JuelScriptEngine.java:180)
| at org.jbpm.pvm.internal.script.JuelScriptEngine.eval(JuelScriptEngine.java:64)
| at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:84)
| at org.jbpm.pvm.internal.script.ScriptManager.evaluate(ScriptManager.java:114)
| ... 17 more
| Caused by: javax.el.PropertyNotFoundException: Cannot find property TestCon
| at de.odysseus.el.util.SimpleResolver.get(SimpleResolver.java:106)
| at de.odysseus.el.util.SimpleResolver.getValue(SimpleResolver.java:126)
| at de.odysseus.el.tree.impl.ast.AstIdentifier.eval(AstIdentifier.java:69)
| at de.odysseus.el.tree.impl.ast.AstEval.eval(AstEval.java:42)
| at de.odysseus.el.tree.impl.ast.AstNode.getValue(AstNode.java:29)
| at de.odysseus.el.TreeValueExpression.getValue(TreeValueExpression.java:120)
| at org.jbpm.pvm.internal.script.JuelScriptEngine.evalExpr(JuelScriptEngine.java:176)
| ... 20 more
| Exception in thread "main" org.jbpm.api.JbpmException: script evaluation error: Cannot find property TestCon
| at org.jbpm.pvm.internal.script.ScriptManager.evaluate(ScriptManager.java:118)
| at org.jbpm.pvm.internal.script.ScriptManager.evaluate(ScriptManager.java:106)
| at org.jbpm.pvm.internal.script.ScriptManager.evaluateExpression(ScriptManager.java:78)
| at org.jbpm.jpdl.internal.activity.JavaActivity.perform(JavaActivity.java:68)
| at org.jbpm.jpdl.internal.activity.JpdlAutomaticActivity.execute(JpdlAutomaticActivity.java:15)
| at org.jbpm.pvm.internal.model.op.ExecuteActivity.perform(ExecuteActivity.java:60)
| at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:637)
| at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperation(ExecutionImpl.java:597)
| at org.jbpm.pvm.internal.model.ExecutionImpl.start(ExecutionImpl.java:201)
| at org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd.execute(StartProcessInstanceInLatestCmd.java:64)
| at org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd.execute(StartProcessInstanceInLatestCmd.java:37)
| at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
| at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:54)
| at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:54)
| at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
| at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.startProcessInstanceByKey(ExecutionServiceImpl.java:66)
| at Test.startUpJBPM(Test.java:40)
| at Test.main(Test.java:28)
| Caused by: javax.script.ScriptException: Cannot find property TestCon
| at org.jbpm.pvm.internal.script.JuelScriptEngine.evalExpr(JuelScriptEngine.java:180)
| at org.jbpm.pvm.internal.script.JuelScriptEngine.eval(JuelScriptEngine.java:64)
| at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:84)
| at org.jbpm.pvm.internal.script.ScriptManager.evaluate(ScriptManager.java:114)
| ... 17 more
| Caused by: javax.el.PropertyNotFoundException: Cannot find property TestCon
| at de.odysseus.el.util.SimpleResolver.get(SimpleResolver.java:106)
| at de.odysseus.el.util.SimpleResolver.getValue(SimpleResolver.java:126)
| at de.odysseus.el.tree.impl.ast.AstIdentifier.eval(AstIdentifier.java:69)
| at de.odysseus.el.tree.impl.ast.AstEval.eval(AstEval.java:42)
| at de.odysseus.el.tree.impl.ast.AstNode.getValue(AstNode.java:29)
| at de.odysseus.el.TreeValueExpression.getValue(TreeValueExpression.java:120)
| at org.jbpm.pvm.internal.script.JuelScriptEngine.evalExpr(JuelScriptEngine.java:176)
| ... 20 more
|
Thanks again for your help.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4248089#4248089
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4248089
16 years, 8 months