This document focus is to describe a service layer on top of the jBPM5 runtime
Following content is just for discussion purpose and everyone is invited to leave comments, ideas, requirements.
Couple of initial thoughts on what should be available. First of all I think that there is a need for different kinds of services:
updated diagram to include recent comments
- transport layer - responsible for providing access to the services remotely over different transports
- business services - most obvious provides straight operations understandable from business point of view like startProcess, signalProcess, addData/Variable but it does not limit to processes it should provide ht services too
- session services - way of controlling and altering session and its configuration
- knowledge service - way of controlling and altering knowledge base
These services are built one on another where knowledge services are at the bottom and business services on top. That means upstream services rely on downstream services.
Business services are more like an extension to what we have available over REST API but completely isolated from the transport specifics. It just provides POJO services that can be used both locally and remotely with well defined data structures that it accepts and return. downstream services will get injected into business services to perform operations.
Session services are mainly dedicated to manage sessions, in two aspects:
- Configuration - provide an easy way of configuring session management that covers session settings itself (persistence, handlers, listeners, etc) as well as life cycle of it (when to dispose, when to reload) and support for multi session configuration.
- Runtime - allows to operate on the session - in most of the cases session API should be enough here
- register handlers
- add/remove event listeners
- set configuration properties
- executing commands
- insert/update/retract facts
- fire rules
- query working memory
responsible for providing business assets into the runtime, so it is mainly configuration related services. adding removing assets, reconfiguring knowledge agent if is used, etc
As one of the consumers of these services is console, it could be good to be able to use console not only to simple start/signal process and complete tasks but as well (based on user roles) maintain the environment - knowledge base, sessions etc.