Information Technology Reference
In-Depth Information
• We can use the task service to interact with human tasks. The code is as follows:
List<TaskSummary> tasks = engine.getTaskService().
getTasksOwned("john", "en-UK");
Long taskId = tasks.iterator().next().getId()
engine.getTaskService().start(taskId, "john");
The
RuntimeEngine
interface could also be extended to add other interactions if ne-
cessary for a particular domain.
When we're done using
RuntimeEngine
in the current transaction or thread, we let
RuntimeManager
know whether it can try to free resources by calling the
dis-
poseRuntimeEngine
method:
manager.disposeRuntimeEngine(engine);
Once we do that, the
engine
instance will be rendered unusable. If we want to interact
with the processes or tasks, we will need to get another instance of
RuntimeEngine
.
Now that we understand the lifecycle of both the
RuntimeManager
and
RuntimeEngine
instances, we can discuss the different types of runtime managers
available for use in the jBPM6 code base.