[jBPM Users] - End tasks in a Fork
by matrixpooh
My process is a fork with two task nodes and a join.
I trigger the process to start both tasks and then end each of them.
During the execution of end() on task 1, the task is being submitted and then immediately re-instantiated. So when the token is at the join, I still have a freshly created task 1 pending in the actor's queue.
Also, it seems like though 'task-end' is called on the child token, the root token proceeds with 'node-enter' on the same task.
Here's the process definition:
| <?xml version="1.0" encoding="UTF-8"?>
|
| <process-definition xmlns="" name="parallel.two.sequential.one">
|
| <swimlane name="...">
| ....
| </swimlane>
|
| <start-state name="start">
| <transition to="fork1"></transition>
| </start-state>
|
| <fork name="fork1">
| <transition to="task-node1" name="to-task-1"></transition>
| <transition to="task-node2" name="to-task-2"></transition>
| </fork>
|
| <join name="join1">
| <transition to="task-node3"></transition>
| </join>
| <task-node name="task-node1" >
| <task swimlane="..." name="Task 1" notify="true">
| <controller class="..."/>
| </task>
| <transition to="join1" name="to-the-end"></transition>
| </task-node>
|
| <task-node name="task-node2">
| <task swimlane="..." name="Task 2" notify="true">
| <controller class="..."/>
| </task>
| <transition to="join1" name="to-the-end"></transition>
| </task-node>
|
| <end-state name="end"></end-state>
| </process-definition>
Here's the snippet of the execution:
|
| ProcessInstance processInstance = new ProcessInstance(processDefinition);
|
| Token token = processInstance.getRootToken();
| assertEquals("start", token.getNode().getName());
|
| token.signal();
|
| Map<String, Token> childTokens = token.getActiveChildren();
| assertTrue(childTokens.size() > 0);
|
| final Iterator<Token> iterator = childTokens.values().iterator();
| Token oneBranchToken = iterator.next();
| TaskMgmtInstance taskManagementInstance = oneBranchToken .getProcessInstance().getTaskMgmtInstance();
| Collection<TaskInstance> taskInstances =
| taskManagementInstance.getUnfinishedTasks(oneBranchToken );
| TaskInstance taskInstance = taskInstances.iterator().next();
| taskInstance.end();
|
| jbpmContext.save(processInstance);
|
Here's the debug log snippet that shows task 1 being submitted and then immediately initialized again:
08:48:11,091 DEBUG|main|: [GraphElement:fireEvent:179] event 'after-signal' on StartState(start) for Token(/)
08:48:11,091 DEBUG|main|: [GraphElement:fireEvent:179] event 'task-end' on Task(Task 1) for Token(/to-task-1)
08:48:11,091 DEBUG|main|: [Controller:submitTaskVariables:23] -------------current node::Task 1
08:48:11,091 DEBUG|main|: [GraphElement:fireEvent:179] event 'before-signal' on Fork(fork1) for Token(/)
08:48:11,091 DEBUG|main|: [GraphElement:fireEvent:179] event 'node-leave' on Fork(fork1) for Token(/)
08:48:11,091 DEBUG|main|: [GraphElement:fireEvent:179] event 'transition' on Transition(to-task-1) for Token(/)
08:48:11,091 DEBUG|main|: [GraphElement:fireEvent:179] event 'node-enter' on TaskNode(task-node1) for Token(/)
08:48:11,107 DEBUG|main|: [Controller:initializeTaskVariables:17] -------------current node::Task 1
08:48:11,107 DEBUG|main|: [GraphElement:fireEvent:179] event 'task-create' on Task(Task 1) for Token(/)
08:48:11,107 DEBUG|main|: [TaskInstance:setActorId:258] assigning task 'Task 1' to 'analyst'
08:48:11,107 DEBUG|main|: [GraphElement:fireEvent:179] event 'task-assign' on Task(Task 1) for Token(/)
08:48:11,107 DEBUG|main|: [GraphElement:executeAction:271] executing Action(Task 1)
08:48:11,107 DEBUG|main|: [Token:lock:748] token[2489] is locked by token[2489]
08:48:11,107 DEBUG|main|: [Mail:send:189] skipping mail because there are no recipients
08:48:11,122 DEBUG|main|: [Token:unlock:765] token[2489] is unlocked by token[2489]
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4266552#4266552
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4266552
16 years, 4 months
[jBPM Users] - Re: Problem moving from 4.1 to 4.2 using Spring configuratio
by RockerRocker
Rolled back everything to as it was JBPM 4CR1 with New instance of Jboss 5.0, still same error - i am so frustated
ERROR AT CLICK OF DEPLOY
| 17:48:52,343 INFO [STDOUT] ***********
| 17:48:52,468 INFO [STDOUT] deployed TestEmail.jpdl.xml
| 17:48:52,593 INFO [STDOUT] Hibernate: select propertyim0_.KEY_ as KEY1_6_, propertyim0_.VERSION_ as VERSION2_6_, propertyim0
| _.VALUE_ as VALUE3_6_ from JBPM4_PROPERTY propertyim0_ where propertyim0_.KEY_='next.dbid'
| 17:48:52,609 INFO [STDOUT] Hibernate: update JBPM4_PROPERTY set VERSION_=?, VALUE_=? where KEY_=? and VERSION_=?
| 17:48:52,687 INFO [DefaultCommandService] exception while executing command org.jbpm.pvm.internal.cmd.DeployCmd@1a0b93e
| org.hibernate.SessionException: Session is closed!
| at org.hibernate.impl.AbstractSessionImpl.errorIfClosed(AbstractSessionImpl.java:72)
| at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:558)
| at org.hibernate.impl.SessionImpl.save(SessionImpl.java:550)
| at org.hibernate.impl.SessionImpl.save(SessionImpl.java:546)
| at org.jbpm.pvm.internal.repository.RepositorySessionImpl.deploy(RepositorySessionImpl.java:60)
| at org.jbpm.pvm.internal.cmd.DeployCmd.execute(DeployCmd.java:47)
| at org.jbpm.pvm.internal.cmd.DeployCmd.execute(DeployCmd.java:33)
| at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
| at org.jbpm.pvm.internal.spring.CommandTransactionCallback.doInTransaction(CommandTransactionCallback.java:50)
| at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:127)
| at org.jbpm.pvm.internal.tx.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:77)
| at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
| at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
| at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
|
JBPM Config file
| <?xml version="1.0" encoding="UTF-8"?>
|
| <jbpm-configuration xmlns="http://jbpm.org/xsd/cfg">
|
| <process-engine-context>
|
| <repository-service />
| <repository-cache />
| <execution-service />
| <history-service />
| <management-service />
| <task-service />
| <identity-service />
|
| <command-service>
| <retry-interceptor />
| <environment-interceptor />
| <spring-transaction-interceptor current="true"/>
|
| <!--<spring-transaction-interceptor />-->
|
| </command-service>
|
|
| <hibernate-configuration>
| <cfg resource="jbpm.hibernate.cfg.xml" />
| </hibernate-configuration>
|
| <deployer-manager>
| <jpdl-deployer />
| </deployer-manager>
|
| <script-manager default-expression-language="juel"
| default-script-language="juel"
| read-contexts="execution, environment, process-engine"
| write-context="">
| <script-language name="juel" factory="org.jbpm.pvm.internal.script.JuelScriptEngineFactory" />
| </script-manager>
|
| <authentication />
|
| <job-executor auto-start="false" />
|
| <id-generator />
|
|
|
| <business-calendar>
| <monday hours="9:00-12:00 and 12:30-17:00"/>
| <tuesday hours="9:00-12:00 and 12:30-17:00"/>
| <wednesday hours="9:00-12:00 and 12:30-17:00"/>
| <thursday hours="9:00-12:00 and 12:30-17:00"/>
| <friday hours="9:00-12:00 and 12:30-17:00"/>
| <holiday period="01/07/2008 - 31/08/2008"/>
| </business-calendar>
|
| </process-engine-context>
|
| <transaction-context>
| <repository-session />
| <pvm-db-session />
| <job-db-session />
| <task-db-session />
| <message-session />
| <timer-session />
| <history-session />
| <transaction />
|
| <hibernate-session current="true" />
| <identity-session />
| </transaction-context>
|
| </jbpm-configuration>
APPLICATION COMMON CONFIG
| <?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.0.xsd
| http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
| http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
|
|
| <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
| <property name="locations">
| <list>
| <value>classpath:/log4j.properties</value>
| </list>
| </property>
| </bean>
|
| <aop:aspectj-autoproxy/>
|
| <tx:advice id="txAdvice" transaction-manager="txManager">
| <tx:attributes>
| <tx:method name="get*" read-only="true" propagation="SUPPORTS" />
| <tx:method name="find*" read-only="true" propagation="SUPPORTS" />
| <tx:method name="*" propagation="REQUIRED" />
| </tx:attributes>
| </tx:advice>
|
| <aop:config>
| <aop:pointcut id="serviceOperation" expression="execution(* com.test.services.**.*(..))" type="regex" />
| <aop:advisor advice-ref="txAdvice" pointcut-ref="serviceOperation" />
| </aop:config>
|
| <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
| <property name="driverClassName" value="com.mysql.jdbc.Driver" />
| <property name="url" value="jdbc:mysql://localhost:3306/jbpm4" />
| <property name="username" value="root" />
| <property name="password" value="revchain" />
| </bean>
|
| <bean id="sessionFactory"
| class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
| <property name="dataSource" ref="dataSource" />
| <property name="hibernateProperties">
| <props>
| <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
| <prop key="hibernate.show_sql">true</prop>
| <prop key="hibernate.hbm2ddl.auto">update</prop>
| </props>
| </property>
| <property name="configLocations">
| <list>
| <value>classpath:com/test/hibernate.cfg.xml</value>
| </list>
| </property>
| <property name="mappingLocations">
| <list>
| <value>classpath:jbpm.execution.hbm.xml</value>
| <value>classpath:jbpm.repository.hbm.xml</value>
| <value>classpath:jbpm.jpdl.hbm.xml</value>
| <value>classpath:jbpm.task.hbm.xml</value>
| <value>classpath:jbpm.history.hbm.xml</value>
| </list>
| </property>
| </bean>
|
| <bean id="txManager"
| class="org.springframework.orm.hibernate3.HibernateTransactionManager">
| <property name="sessionFactory" ref="sessionFactory" />
| </bean>
|
| </beans>
H E L P
H E L P
[/img]
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4266422#4266422
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4266422
16 years, 4 months