[jBPM Users] - jBPM4.1 - Spring 2.5.x - transactionManagement questions
by CouchPotatoe
Hi there,
I've created a simple jBPM 4.1 process with 4 subsequent activities that each trigger a transactional service (@Service) that they're injected with.
Obviously I've used Spring to configure jBPM and the services. I've used Andries Inzé's demo app to inspire me on how to do this.
Different from Andries's demo, I make use of a Atomikos JTA transactionManager (platformTransactionManager), and not the Hibernate transaction manager.
I would like every activity/service (based on JPA/Hibernate) to commit after it has been executed.
I have 2 questions:
- when using a single (JTA) transactionmanager for both jBPM and my JPA-services, the WHOLE process including ALL services are put in a single, atomic transaction block. When eg the 3th process fails, all previous services are rolled back too. This is not the desired behaviour for my app. Is this behaviour by design of jBPM/Spring integration?
- when specifying 2 seperate transactionmanager beans (a Hibernate platformTransactionManager named 'transactionManager' linked to jBPM's sessionFactory, and a jtaPlatformTransactionManager named 'transactionManager.jta' and used by the entityManagerFactory and @Service objects), jBPM fails with a message saying that a platformTransactionManager could not be found. I thought that specifying 2 seperate transactionManagers would solve my problem, as jBPM processes would use thair own transaction(Manager), independent from services/transactions executed by member-activities.
Or should I make use of the same transactionManager (JTA/Atomikos), but make jBPM and my services use different UserTransaction-s ? If this is the case, how do I specify that jBPM should make use of some specific userTransaction(-name)?
And how should I specify that jBPM makes use of a particular transactionManager-bean in Spring, instead of the default bean with name 'transactionManager'?
All help would be very welcome !!
Thanks
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4257830#4257830
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4257830
14 years, 8 months
[jBPM Users] - Re: Translation of task node from jBPM3 to 4
by newcomer1
"kukeltje" wrote : no there is not. And not sure if it will return as it was or whether alternative ways (more bpmn like) will be implemented.
|
| What is the behaviour you need?
Im quite new to BPM and jBPM but I want to re implement an existing jBPM 3.x process in jBPM 4, but the existing process definition uses more or less only task-nodes. All the 3.x projects I've seen seems to use task-node definitions extensively and there is no examples/documentation in jbpm 4 that covers how to achieve the same type of behavior. Seems like what im after is grouping and/or fork/join.
The behavior that I want is more or less like this:
When entering a certain state (task-node) I want to create 5 tasks that have to be done to transition to the next state. The order these tasks are performed in do not matter and should not be enforced.
| <task-node name="received" blocking="true" create-tasks="true">
| <task name="reminder" blocking="true" duedate="1 business days">
| <assignment class="xx.AssignmentHandler"/>
| </task>
| <task name="evaluate" blocking="true" duedate="2 business days">
| xxx
| </task>
| <task name="createPlan" blocking="true" duedate="1 business days">
| xxxx
| </task>
|
| <more tasks, timers etc./>
|
| <transition name="toAccepted" to="accepted"/>
| <transition name="toRejected" to="rejected"/>
| </task-node>
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4257812#4257812
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4257812
14 years, 8 months
[jBPM Users] - Ending task with timer - session is closed
by Jimmy56
Hi,
I'm using following configuration:
JBoss AS 4.3
jBPM 3.2.2
Seam 2.0.2
Hibernate 3.3.0
jBPM is configured to use JTA. JbpmContext is injected with Hibernate session took from Seam managed EntityManager.
When I end task, which has a timer, everything works fine but at the end of rendering phase exception is thrown:
| 02:50:26,345 ERROR [TaskMgmtSession] org.hibernate.SessionException: Session is closed!
| 02:50:26,438 ERROR [SeamPhaseListener] uncaught exception
| org.jbpm.JbpmException: couldn't get task instance '146'
| at org.jbpm.db.TaskMgmtSession.getTaskInstance(TaskMgmtSession.java:190)
| at org.jbpm.JbpmContext.getTaskInstanceForUpdate(JbpmContext.java:251)
| at org.jboss.seam.bpm.TaskInstance$1.work(TaskInstance.java:49)
| at org.jboss.seam.bpm.TaskInstance$1.work(TaskInstance.java:43)
| at org.jboss.seam.util.Work.workInTransaction(Work.java:41)
| at org.jboss.seam.bpm.TaskInstance.getTaskInstance(TaskInstance.java:39)
| 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 org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
| at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
| at org.jboss.seam.Component.callComponentMethod(Component.java:2092)
| at org.jboss.seam.Component.unwrap(Component.java:2118)
| at org.jboss.seam.Component.getInstance(Component.java:1890)
| at org.jboss.seam.Component.getInstance(Component.java:1855)
| at org.jboss.seam.Component.getInstance(Component.java:1832)
| at org.jboss.seam.Component.getInstance(Component.java:1827)
| at org.jboss.seam.bpm.TaskInstance.instance(TaskInstance.java:64)
| at org.jboss.seam.contexts.BusinessProcessContext.getTaskInstance(BusinessProcessContext.java:231)
| at org.jboss.seam.contexts.BusinessProcessContext.getNamesFromContext(BusinessProcessContext.java:109)
| at org.jboss.seam.contexts.BusinessProcessContext.getNames(BusinessProcessContext.java:97)
| at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:241)
| at org.jboss.seam.contexts.Contexts.flushAndDestroyContexts(Contexts.java:356)
| at org.jboss.seam.contexts.FacesLifecycle.endRequest(FacesLifecycle.java:112)
| at org.jboss.seam.jsf.SeamPhaseListener.afterRenderResponse(SeamPhaseListener.java:513)
| at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:245)
| at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:192)
| at com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:175)
| at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:114)
| at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
| at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
| at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
| at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
| at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:619)
| Caused by: org.hibernate.SessionException: Session is closed!
| at org.hibernate.impl.AbstractSessionImpl.errorIfClosed(AbstractSessionImpl.java:49)
| at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:874)
| at org.hibernate.impl.SessionImpl.get(SessionImpl.java:815)
| at org.hibernate.impl.SessionImpl.get(SessionImpl.java:808)
| at org.jbpm.db.TaskMgmtSession.getTaskInstance(TaskMgmtSession.java:186)
| ... 68 more
| 02:50:26,438 ERROR [SeamPhaseListener] swallowing exception
| org.jbpm.JbpmException: couldn't get task instance '146'
| at org.jbpm.db.TaskMgmtSession.getTaskInstance(TaskMgmtSession.java:190)
| at org.jbpm.JbpmContext.getTaskInstanceForUpdate(JbpmContext.java:251)
| at org.jboss.seam.bpm.TaskInstance$1.work(TaskInstance.java:49)
| at org.jboss.seam.bpm.TaskInstance$1.work(TaskInstance.java:43)
| at org.jboss.seam.util.Work.workInTransaction(Work.java:41)
| at org.jboss.seam.bpm.TaskInstance.getTaskInstance(TaskInstance.java:39)
| 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 org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
| at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
| at org.jboss.seam.Component.callComponentMethod(Component.java:2092)
| at org.jboss.seam.Component.unwrap(Component.java:2118)
| at org.jboss.seam.Component.getInstance(Component.java:1890)
| at org.jboss.seam.Component.getInstance(Component.java:1855)
| at org.jboss.seam.Component.getInstance(Component.java:1832)
| at org.jboss.seam.Component.getInstance(Component.java:1827)
| at org.jboss.seam.bpm.TaskInstance.instance(TaskInstance.java:64)
| at org.jboss.seam.contexts.BusinessProcessContext.getTaskInstance(BusinessProcessContext.java:231)
| at org.jboss.seam.contexts.BusinessProcessContext.getNamesFromContext(BusinessProcessContext.java:109)
| at org.jboss.seam.contexts.BusinessProcessContext.getNames(BusinessProcessContext.java:97)
| at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:241)
| at org.jboss.seam.contexts.Contexts.flushAndDestroyContexts(Contexts.java:356)
| at org.jboss.seam.contexts.FacesLifecycle.endRequest(FacesLifecycle.java:112)
| at org.jboss.seam.jsf.SeamPhaseListener.afterRenderResponse(SeamPhaseListener.java:513)
| at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:245)
| at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:192)
| at com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:175)
| at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:114)
| at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
| at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
| at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
| at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
| at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:619)
| Caused by: org.hibernate.SessionException: Session is closed!
| at org.hibernate.impl.AbstractSessionImpl.errorIfClosed(AbstractSessionImpl.java:49)
| at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:874)
| at org.hibernate.impl.SessionImpl.get(SessionImpl.java:815)
| at org.hibernate.impl.SessionImpl.get(SessionImpl.java:808)
| at org.jbpm.db.TaskMgmtSession.getTaskInstance(TaskMgmtSession.java:186)
| ... 68 more
|
I'm confused what is seam trying to do on destroying of context and where is TaskInstance, which it tries to retrieve, registered. Has it something to do with JobExecutor? Or any other suggestions?
Thank you.
regards,
Jakub
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4257770#4257770
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4257770
14 years, 8 months