This content has been marked as final.
Show 3 replies
-
1. Re: How to get the ProcessInstance for a Task in jBpm 4.0 CR
rams.rapol Jun 16, 2009 12:12 PM (in response to ahmy)How about this...
TaskImpl task = (TaskImpl) taskService.getTask(is);
task.getProcessInstance().getDbid(); -
2. Re: How to get the ProcessInstance for a Task in jBpm 4.0 CR
ahmy Jun 17, 2009 12:00 AM (in response to ahmy)I tried the above code but I am getting the following exception
org.hibernate.LazyInitializationException <init> SEVERE: could not initialize proxy - no Session org.hibernate.LazyInitializationException: could not initialize proxy - no Session
I think the exception results from the Hibernate Session being closed after callling any TaskService method,
Is there another way? -
3. Re: How to get the ProcessInstance for a Task in jBpm 4.0 CR
kukeltje Jun 17, 2009 4:16 AM (in response to ahmy)the new jBPM console does this:
TaskService taskService = processEngine.getTaskService(); Task task = taskService.getTask(taskId); // access the processdefition TaskImpl cast = ((TaskImpl) task); ExecutionImpl processInstance = cast.getProcessInstance(); String processInstanceId = processInstance.getId(); String processId = processInstance.getProcessDefinition().getId();
The difference being the 'getId()' instead of 'getDbId()'