The call jbpmContext.close() closes the "owning session".
Both your methods as using the "jbpmContext" variable.
So, when you call the method getTaskinstanceByID(String taskInstanceId), it calls
jbpmContext.close() in your finally block. This closes the session. Now remember, your
"jbpmContext" is shared by both methods, so when your getProcessInstance(String
taskId) method tries to call taskInstance.getTaskMgmtInstance().getProcessInstance(), the
session is already closed.
Try changing your getTaskinstanceByID method to this:
| public TaskInstance getTaskinstanceByID(String taskInstanceId){
| taskInstance = jbpmContext.getTaskInstance(Long.parseLong(taskInstanceId));
| return taskInstance;
| }
|
As you already have a jbpmContext initialized, don't recreate it in this method.
Hope this helps.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4086508#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...