JBoss Community

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

created by Rahul Agrawal in jBPM - View the full discussion

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

Start a new discussion in jBPM at Community