JBoss Community

Dispose of knowledgeSession when use with persistence

created by Andy Yeung in jBPM - View the full discussion

We are trying to use JBPM 5 with persistence to handle long workflow involving human task. I have read some other dicussion in the forum and they suggest to use 1 session for each workflow while having a single session to handle all schedule task. Session is reinitialize when handling user response like complete task such that workflow will not stucked and continue to subsequent nodes. The problem comes when the task complete.

 

 

BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
getTaskClient().complete(pTaskId, pUserId, contentData, responseHandler);
responseHandler.waitTillDone(10000);
knowledgeSession.dispose();

 

I found that responseHandler.waitTillDone already jump out when the complete msg successfully sent to task server.

It doesn't wait until the CommandBasedWSHumanTaskHandler task completed event to be executed.

This make the session closed and the jbpm app scope transaction manager being released and cause the transitted workflow state in CommandBasedWSHumanTaskHandler cannot be persisted.

 

I want to know if it's just my usage or configuration problem. It seems it require me to modify the CommandBasedWSHumanTaskHandler  and let my code above to wait until CommandBasedWSHumanTaskHandler.TaskCompletedHandler to finish its job first before I dispose the session.

Reply to this message by going to Community

Start a new discussion in jBPM at Community