[jboss-user] [jBPM] - Re: Terminate Active ProcessInstance in jbpm 5.2 using Local Task Service

Rahul Agrawal do-not-reply at jboss.com
Wed Jun 13 03:44:23 EDT 2012


Rahul Agrawal [https://community.jboss.org/people/rahulamt] created the discussion

"Re: Terminate Active ProcessInstance in jbpm 5.2 using Local Task Service"

To view the discussion, visit: https://community.jboss.org/message/741408#741408

--------------------------------------------------------------
I was having the same problem. But I think it was because of the transaction timeout issue. I reperformed the claiming activity, the error was gone. 
But I have another issue. 
In my web application I am having two tabs for the inbox. One for the tasks pending with the user and other for the tasks of the roles(whose status is ready and can be claimed). Basically these two are user inbox and role inbox respectively. The issue is even when I am claiming the task in the database the task status is not changed. Its ready only. So its not coming in the user inbox(owned tasks) instead coming in the role inbox only. When I am claiming the task again. I get an error saying the status of the task is not matched and sometimes I get the above error.

When I digged dipper into the task, I found that the after I claim the task the task status is not persisted in the database and in the hibernate cache for that particular task object the status is different(Reserved). So while getting the tasks from the database I get the claimed task in the role inbox not in the user inbox.

The similar issue I found with the complete task API.
I am using the following code for completing the task 





 ***public
**
* **static** **void** completeTask(**long** taskId, Map data, String userId) **throws** InterruptedException {
//connect();
















++tService++.start(taskId, userId);
ContentData contentData = 
**null**; 




**if** (data != *null*) {
ByteArrayOutputStream bos = 
**new** ByteArrayOutputStream();ObjectOutputStream out;





**try**
{

#
out =
**new** ObjectOutputStream(bos); 

out.writeObject(data);out.close();


contentData = 
**new** ContentData(); 
contentData.setContent(bos.toByteArray());
contentData.setAccessType(AccessType.+Inline+
);} 




**catch**
(IOException e) {
e.printStackTrace();
}
}





++tService++.complete(taskId, userId, contentData); 



//responseHandler.waitTillDone(5000);

}



#
#



If I pass a null Map object to the above method I am getting the similar issue. The task status is not changed. Its still reserved only.

--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/741408#741408]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120613/462c2bf7/attachment-0001.html 


More information about the jboss-user mailing list