Finally found the problem.<br><br>JBPM&#39;s WSHumanTaskHandler connects to JBPM HumanTask server only when executing a workitem. If a connection is already established it doesn&#39;t connect again so it is durable. At connection time, it also registers taskEventHandlers, one of them for receiving TaskCompleted events.<br>

<br>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&#39;s nobody listening for events because JBPM doesn&#39;t connect to the server until a new HumanTask workitem is executed, so the process doesn&#39;t continue it&#39;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.<br>

<br>Not without problems, when querying the knowledge session model a new exception arises:<br><br>javax.persistence.TransactionRequiredException: No active JTA transaction on joinTransaction call<br>   at org.hibernate.ejb.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:1183)<br>

   at org.hibernate.ejb.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:1143)<br>   at org.drools.persistence.jpa.JpaPersistenceContextManager.beginCommandScopedEntityManager(JpaPersistenceContextManager.java:83)<br>

<br><br>But that&#39;s another thing. :(<br><br>Created a Jira issue for this:  <a href="https://issues.jboss.org/browse/JBPM-3673">https://issues.jboss.org/browse/JBPM-3673</a><br><br><br clear="all">Alberto R. Galdo<br>

<a href="mailto:argaldo@gmail.com" target="_blank">argaldo@gmail.com</a><br><br><br><div class="gmail_quote">On Tue, Jun 5, 2012 at 8:44 AM, Alberto R. Galdo <span dir="ltr">&lt;<a href="mailto:argaldo@gmail.com" target="_blank">argaldo@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>Sorry, I didn&#39;t mention ... We&#39;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&#39;re dependent on each other ... :(<br>


<br>Any hints on the subject?<span class="HOEnZb"><font color="#888888"><br><br clear="all">Alberto R. Galdo<br><a href="mailto:argaldo@gmail.com" target="_blank">argaldo@gmail.com</a></font></span><div class="HOEnZb"><div class="h5">

<br><br>
<br><br><div class="gmail_quote">On Mon, Jun 4, 2012 at 6:02 PM, Edson Tirelli <span dir="ltr">&lt;<a href="mailto:ed.tirelli@gmail.com" target="_blank">ed.tirelli@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div><br></div>   Alberto,<div><br></div><div>   Which versions of Drools and jBPM are you using?</div><div><br></div><div>   Edson<br><br><div class="gmail_quote"><div><div>On Mon, Jun 4, 2012 at 3:55 AM, Alberto R. Galdo <span dir="ltr">&lt;<a href="mailto:argaldo@gmail.com" target="_blank">argaldo@gmail.com</a>&gt;</span> wrote:<br>



</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>Hi guys,<br><br>   We are using JBPM 5 for long running processes in one of our products, both, the knowledge session and WorkItemInfo &amp; ProcessInstanceInfo are persisted in a PostgreSQL database. Our processes involve a set of automated tasks along with UserTasks handled inside JBPM&#39;s HumanTask provided server  ( the one that uses mina &amp; JPA ).<br>





<br>   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 &amp; JBPM contexts . We&#39;ve tested a persistent approach like this:<br>





<br>     - We started our application and started several instances of a process that involves at least one human task node.<br>     - We&#39;ve completed several human tasks in the current session and things went ok, workitems got completed &amp; processinstances desappeared as processes came to and end.<br>





     - We left several human task in state&quot;Ready&quot; for our users to consume afterwards.<br>     - We restarted the application and let JBPM rehydrate it&#39;s context via   JPAKnowledgeService.loadStatefulKnowledgeSession()   <br>





<br>   Then we acquired and completed a &quot;Ready&quot; HumanTask, it got completed in JBPM HumanTask server&#39;s database backend but the process attached never got neither updater, nor its subsequent nodes were executed. This is weird. <br>





<br>    We first tought it was a rehydratation problem and that the process definition was not loaded properly, but what was our suprise when we&#39;ve been able to execute several new process instances wich we could complete properly. So, seems that we are able to complete &quot;current&quot; ( as in the current session, not the rehydrated ones ) process instances, but not able to complete process instances that are not started in the &quot;current&quot; session ( the rehydrated ones ).<br>





<br>   What&#39;s wrong here. Is it not possible to resume a process in a rehydrated session when human tasks &amp; JBPM&#39;s HumanTask server are involved?<br><br><br>Greets,<br><br clear="all">Alberto R. Galdo<br><a href="mailto:argaldo@gmail.com" target="_blank">argaldo@gmail.com</a><br>





<br><br>
<br></div></div>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><span><font color="#888888"><br><br clear="all"><div><br></div>-- <br>  Edson Tirelli<br>  JBoss Drools Core Development<br>  JBoss by Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a><br>



</font></span></div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br>
</div></div></blockquote></div><br>