[jboss-user] [jBPM] - Mina Human Task Server and close connections - don't refresh the session

gardellajp do-not-reply at jboss.com
Mon Jan 23 10:22:07 EST 2012

gardellajp [https://community.jboss.org/people/gardellajp] created the discussion

"Mina Human Task Server and close connections - don't refresh the session"

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

Hi folks,

I have a problem and I don't found a good solution to this. The problem is that I complete a task and the session didn't refresh becouse the handler and the session is dispose. See the next code:

<< CODE>>>
TaskClient client = obtainATaskClient();

Task task = handler.getTask();

//obtain the session
int sessionId = task.getTaskData().getProcessSessionId();
StatefulKnowledgeSession session = JPAKnowledgeService.loadStatefulKnowledgeSession(sessionId,knowledgeBase, null, envoriment);
CommandBasedWSHumanTaskHandler handler = new CommandBasedWSHumanTaskHandler(session);
session.getWorkItemManager().registerWorkItemHandler("Human Task",handler);

 //complete the task
client.complete(taskId, userId, outputData, responseHandler);

isDone = responseHandler.waitTillDone(time);

// -- Close resources --

<<< END CODE >>>>

I can fix with if I put this line after the comment // -- Close resources --:


When I put this, Mina server communicate with the handler and refresh the session. Is a very poor workaround. 

I try cache the session and close after some time, but if I use this approach have problems that said WorkItemInfo doesn't exists, becouse the handler delete complete human task. 

So my question is:

How can I close the session only after the handler refresh it?


Reply to this message by going to Community

Start a new discussion in jBPM at Community

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

More information about the jboss-user mailing list