Information Technology Reference
In-Depth Information
ableItemsFactory , and it provides a contract for the process engine to populate its
work item handlers and different listener types for process and rule executions:
public interface RegisterableItemsFactory {
Map<String, WorkItemHandler> getWorkItemHandlers(
RuntimeEngine runtime);
List<ProcessEventListener> getProcessEventListeners(
RuntimeEngine runtime);
List<AgendaEventListener> getAgendaEventListeners(
RuntimeEngine runtime);
List<WorkingMemoryEventListener>
getWorkingMemoryEventListeners(
RuntimeEngine runtime);
}
As you might have noticed already, external connectors can be implemented in a bidirec-
tional way—both to expose the internal functionality of the engine to the rest of the ap-
plication components and to configure signaling methods from external components back
into the engine. It is because of this reason that listeners and work item handlers are
provided with a reference to the runtime engine, so you can pass it on to your own con-
nectors whenever they might need them.
Defining our runtime environment
Another thing to notice is that all these interfaces (except for RuntimeManager ) define
just getters for different components that the runtime will need at specific instances of
rules and processes execution paths. You can implement your own to return the different
implementations you wish as you see fit. However, the jbpm-runtime-manager pro-
ject provides two implementations: SimpleRuntimeEnvironment and De-
faultRuntimeEnvironment .
The SimpleRuntimeEnvironment implementation provides setters as well as get-
ters for all the configuration components, or enough setters to create the configuration
components based on simpler parameters. The DefaultRuntimeEnvironment in-
stance extends the first implementation to add the most usual configurations as a default
template. This default configuration will provide a persistent environment for sessions to
be created, with history logs and the Human task component preconfigured.
Search WWH ::




Custom Search