[jboss-user] [JBoss jBPM] - Re: get processinstance with task id
dleerob
do-not-reply at jboss.com
Thu Sep 20 05:11:09 EDT 2007
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#4086508
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4086508
More information about the jboss-user
mailing list