Finally found the problem.
JBPM's WSHumanTaskHandler connects to JBPM HumanTask server only when executing a workitem. If a connection is already established it doesn't connect again so it is durable. At connection time, it also registers taskEventHandlers, one of them for receiving TaskCompleted events.
In a JPA persisted environment where a rehydrated knowledge session which has pending workitems with tasks living in the human task server has been loaded, if a task get completed at the human task server, there's nobody listening for events because JBPM doesn't connect to the server until a new HumanTask workitem is executed, so the process doesn't continue it's execution. This behaviour will continue to happen until a new workitem gets executed, then the connection will be stablished, callback handlers registered, and from that point on workitems, past and future, get completed and the process execution resumed.
Not without problems, when querying the knowledge session model a new exception arises:
javax.persistence.TransactionRequiredException: No active JTA transaction on joinTransaction call
at org.hibernate.ejb.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:1183)
at org.hibernate.ejb.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:1143)
at org.drools.persistence.jpa.JpaPersistenceContextManager.beginCommandScopedEntityManager(JpaPersistenceContextManager.java:83)
But that's another thing. :(
Created a Jira issue for this: https://issues.jboss.org/browse/JBPM-3673
Alberto R. Galdo
argaldo@gmail.com
Sorry, I didn't mention ... We're using the latest stable version of both Drools, JBPM and Knowledge API ... Drools 5.4.0.Final, JBPM 5.3.0.Final mostly because they're dependent on each other ... :(
Any hints on the subject?
Alberto R. Galdo
argaldo@gmail.com
On Mon, Jun 4, 2012 at 6:02 PM, Edson Tirelli <ed.tirelli@gmail.com> wrote:Alberto,Which versions of Drools and jBPM are you using?EdsonOn Mon, Jun 4, 2012 at 3:55 AM, Alberto R. Galdo <argaldo@gmail.com> wrote:
_______________________________________________Hi guys,
We are using JBPM 5 for long running processes in one of our products, both, the knowledge session and WorkItemInfo & ProcessInstanceInfo are persisted in a PostgreSQL database. Our processes involve a set of automated tasks along with UserTasks handled inside JBPM's HumanTask provided server ( the one that uses mina & JPA ).
For maintenance purposes, our application needs to be restarted once in a while so we need our processes to keep running after a sucesful rehydratation of the knowledge & JBPM contexts . We've tested a persistent approach like this:
- We started our application and started several instances of a process that involves at least one human task node.
- We've completed several human tasks in the current session and things went ok, workitems got completed & processinstances desappeared as processes came to and end.
- We left several human task in state"Ready" for our users to consume afterwards.
- We restarted the application and let JBPM rehydrate it's context via JPAKnowledgeService.loadStatefulKnowledgeSession()
Then we acquired and completed a "Ready" HumanTask, it got completed in JBPM HumanTask server's database backend but the process attached never got neither updater, nor its subsequent nodes were executed. This is weird.
We first tought it was a rehydratation problem and that the process definition was not loaded properly, but what was our suprise when we've been able to execute several new process instances wich we could complete properly. So, seems that we are able to complete "current" ( as in the current session, not the rehydrated ones ) process instances, but not able to complete process instances that are not started in the "current" session ( the rehydrated ones ).
What's wrong here. Is it not possible to resume a process in a rehydrated session when human tasks & JBPM's HumanTask server are involved?
Greets,
Alberto R. Galdo
argaldo@gmail.com
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Edson Tirelli
JBoss Drools Core Development
JBoss by Red Hat @ www.jboss.com
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users