-
1. Re: [Q] JBPM 4.4 JbpmException
mwohlf Jul 27, 2010 12:43 PM (in response to khoying)The problem is there is a database session needed if you call some of the methods, especially on the persistent objects like task, execution, process etc.... that's just the nature of mapping objects to a database, it is not a bug...
you can:
- stick with the methods of the services (RepositoryService, IdentityService, etc)
- open/close an environment that manages the session for you (see developers guide section 6.5):
EnvironmentImpl environment = (EnvironmentImpl) ((EnvironmentFactory)processEngine).openEnvironment();
try {
// do your stuff here
} finally {
environment.close();
} - create a command that is executed by the process engine (see developers guide section 6.6):
processEngine.execute(new Command() {
public Object execute(Environment env) {
// do your stuff here
return null;
}
});
-
2. Re: [Q] JBPM 4.4 JbpmException
khoying Jul 27, 2010 4:20 PM (in response to mwohlf)Thank you so much for your assistance. This was terrific and very helpful!
Have a great week!
-
3. Re: [Q] JBPM 4.4 JbpmException
yushanyuan Jul 27, 2010 9:07 PM (in response to mwohlf)hello ,wohlfart:
i read the three points that you given. it's indeed helpful. but i have some trouble with the point 1,"stick with the methods of the services (RepositoryService, IdentityService, etc)". could you give an example or something? Thanks
-
4. Re: [Q] JBPM 4.4 JbpmException
mwohlf Jul 28, 2010 1:40 AM (in response to yushanyuan)hi derek,
for example using the taskService to get some subtasks likeprocessEngine.getTaskService().getSubTasks(taskId);
instead of task.getSubTask() when there is no hibernate session around.