Thanks Mauricio, I will post in the forum, but before I will work on this issue a little more. I think I messed up the entity managers.<br><br><br><div class="gmail_quote">On Wed, Aug 1, 2012 at 8:30 PM, Mauricio Salatino <span dir="ltr">&lt;<a href="mailto:salaboy@gmail.com" target="_blank">salaboy@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">Hi Marcelo,<div>You should not post user questions to the jbpm-dev list, you should use the forum for this kind of questions.</div>
<div><br></div><div>Can you please post the question in the forum with a test to reproduce your problem?</div>

<div>Cheers<br><br><div class="gmail_quote"><div><div class="h5">On Wed, Aug 1, 2012 at 10:38 PM, Marcelo Zabalet <span dir="ltr">&lt;<a href="mailto:zabalet@gmail.com" target="_blank">zabalet@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 class="h5">

Hey.<br><br>I&#39;m working on a long-term government project for the implementation of BPM. We are building an application with jBPM to expose BPM to other projects as a service. I&#39;ll be working with this for a while. <br>



<br>Well, going to the point, the problem I have now is an object &quot;Task&quot; with stale data when I try to do a CompleteTask operation.<br><br>To set the context: this project is based on<br><br>    &lt;parent&gt;<br>



        &lt;groupId&gt;org.drools&lt;/groupId&gt;<br>        &lt;artifactId&gt;droolsjbpm-parent&lt;/artifactId&gt;<br>        &lt;version&gt;5.4.0.Final&lt;/version&gt;<br>    &lt;/parent&gt;<br><br>using, at the moment, a local strategy for the Human Task Service (not Mina, nor MQ) accesing the service with this class: <br>



<br>org.jboss.bpm.console.server.integration.TaskManagement.<br><br><br>By completing a task from here: TaskManagement.completeTask (taskId, data, user ID), I found the symptom of losing the assignment of task vars to the process. I don&#39;t know what exactly the problem is, but trying to solve the problem, I realized that here:<br>



<br>SyncWSHumanTaskHandler.handleCompletedTask(taskId) {<br>  Task task = client.getTask(taskId);<br>  ...<br>  if (task.getTaskData().getStatus() == Status.Completed)) {<br>  ...<br>}<br><br>the system ends up with a Task object with stale data. In the database, the task at hand has a Completed status, but in this case, the Task object has an InProgress status. So, the if-condition evaluates to false, never executing the corresponding block where lies the vars assigment stuff.<br>



<br>Here is a copy of the stack at the three moments where the completeTask operation acquires a Task object from the database (or the persistence context).<br><br>This acquires a task and marks it as InProgress<br><br>    TaskServiceSession.getTask(long) line: 527    <br>



    TaskServiceSession.taskOperation(Operation, long, String, String, ContentData, List&lt;String&gt;) line: 406    <br>    LocalTaskService.start(long, String) line: 276    <br>    TaskManagement.completeTask(long, Map, String) line: 95    <br>



<br>This acquires a task and marks it as Completed. I checked at this point and is the same Task Object (I mean same java Obect in memory), so far so good.<br><br>    TaskServiceSession.getTask(long) line: 527    <br>    TaskServiceSession.taskOperation(Operation, long, String, String, ContentData, List&lt;String&gt;) line: 406    <br>



    LocalTaskService.complete(long, String, ContentData) line: 80    <br>    TaskManagement.completeTask(long, Map, String) line: 113    <br><br>This acquires a Task for the work-item stuff. <br>This is where the problem lies. The Task object is a diferent one from the previous ones and has stale data, so the status is InProgress.<br>



I think there is a conflict with the Entity Managers here...<br><br>    TaskServiceSession.getTask(long) line: 527    <br>    LocalTaskService.getTask(long) line: 165    <br>    SyncWSHumanTaskHandler$TaskCompletedHandler.handleCompletedTask(long) line: 345    <br>



    SyncWSHumanTaskHandler$TaskCompletedHandler$1.run() line: 333    <br>    Thread.run() line: 662    <br><br><br>Obviously, the best answer is how I fix this to get it working ASAP :) <br>Talking seriously, I will apreciate any tip or clue to help me focus in the right direction. Maybe I&#39;m wrong from the root. Some of the questions that arise:<br>



I see that I&#39;m using (indirectly) org.jbpm.process.workitem.wsht.SyncWSHumanTaskHandler that is marked as @Deprecated.<br>Why is it deprecated or what should I use instead?<br>I choose a local strategy, is still contemplated or will be removed and no one is thinking on local in favor of Mina, queues, or something else?<br>



<br><br>Thanks in advance.<span><font color="#888888"><br><br><br>Marcelo.<br>
</font></span><br></div></div>_______________________________________________<br>
jbpm-dev mailing list<br>
<a href="mailto:jbpm-dev@lists.jboss.org" target="_blank">jbpm-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/jbpm-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/jbpm-dev</a><br>
<br></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br> - MyJourney @ <a href="http://salaboy.wordpress.com" target="_blank">http://salaboy.wordpress.com</a><div> - Co-Founder @ <a href="http://www.jugargentina.org" target="_blank">http://www.jugargentina.org</a><br>


 - Co-Founder @ <a href="http://www.jbug.com.ar" target="_blank">http://www.jbug.com.ar</a><br> <br> - Salatino &quot;Salaboy&quot; Mauricio -</div><br>
</font></span></div>
</blockquote></div><br>