is used to surround persistent operations to processes.
Obtain JbpmContext's via
org.jbpm.JbpmConfiguration.createJbpmContext and put it in a try-finally block like this:
JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
try {
TaskInstance taskInstance = ...
...do your process operations...
// in case you update a process object that was not fetched
// with a ...ForUpdate method, you have to save it.
jbpmContext.save(processInstance);
finally {
jbpmContext.close();
}
A JbpmContext separates jBPM from a sprecific environment.
For each service that jBPM uses, there is an interface specified in the jBPM codebase.
jBPM also includes implementations that implement these services by using services in a
specific environment. |