Nova Bonita Workflow APIs for handling workflow definition, deployment,
execution and history.
Nova Bonita is the name of new version of Bonita v4.
"Nova" technology is based on the "Process Virtual Machine"
conceptual model for processes. The Process Virtual Machine defines a
generic process engine enabling support for multiple process languages
(such BPEL, XPDL).
Nova Bonita is an extensible and embeddable workflow solution that
can be
easily deployed in both standard (JSE) and Enterprise (JEE)
environments.
- Nova Bonita can be easily integrated in your application as a
workflow library. In that
case your application can directly reach the workflow APIs as POJOs.
- Nova Bonita can also be deployed in a JEE application
server and so leverage it remotely
thanks to the Workflow Session Beans APIs.
As a example of this, Nova Bonita provides a default JEE integration
with a EJB3 lightweight container
such Easybeans
. You can easily deploy Nova Bonita in another JEE application
server by just deploying the bonita.ear file in your
favorite application server.
Nova Bonita APIs are divided into 5 different areas:
- {@link
org.ow2.bonita.facade.DefinitionAPI}: to create/modify major
process elements into the engine (packages,
processes, activities, role mappers, variables by calling java methods
instead of importing xpdl files. It will allows also to
modify the execution of runtime elements such as tasks and instances.
This API is not yet supported.
- {@link
org.ow2.bonita.facade.QueryDefinitionAPI}: to get
definition/static informations for elements defined in the xpdl file:
packages, processes, activities, participants, hooks, mappers,
performer assignments.
- {@link
org.ow2.bonita.facade.RuntimeAPI}: to manage process,
instance and task life cycle operations as well as to set/updates
variables.
- {@link
org.ow2.bonita.facade.QueryRuntimeAPI}:
- to get tasks list (aka manual activities)
for the authenticated user;
- to get recorded/runtime
informations for instances, activities, tasks (will add support for
dynamic queries
in the future);
- to
get/list current and definition variables within activities or process
instances/deployed processes).
- {@link
org.ow2.bonita.facade.ManagementAPI}: to deploy workflow
processes into the engine. XPDL files and advanced entities
such hooks, mappers and performer assignments can be deployed
individually or in one shot.
There's also a generic API that allow to execute specific commands that
should be needed by the workflow based application.
- {@link
org.ow2.bonita.facade.CommandAPI}: to allow developpers to
execute its own commands (package within the application).
Nova Bonita local vs remote applications
An utility class has been provided to unify access to Bonita APIs from both local and remote environments
and so to avoid the use of lookups in JEE deployments: org.ow2.bonita.util.AccessorUtil. Through this
class, Nova Bonita APIs can be reached in a unified way in both local and remote applications. From a
developer point of view Nova Bonita APIs are just Java POJOs.
The AccessorUtil objet will also be leveraged inside BPM artifacts such hooks, mappers or performer
assignments to deal with Nova Bonita APIs.
For that to be done, the system property called "org.ow2.bonita.api-type" must be defined at
client side to specify whether the APIs will be reached locally or remotely (possible values are
"Standard","AutoDetect",'EJB2" and "EJB3").
There are two available methodes in the AccessorUtil class (under the org.ow2.bonita.util package):
- getQueryAPIAccessor(): returning the helper class QueryAPIAccessor giving access to
QueryRuntimeAPI and QueryDefinitionAPI interfaces.
- getAPIAccessor(): returning the helper class APIAccessor giving access to QueryRuntimeAPI,
QueryDefinitionAPI, RuntimeAPI, ManagementAPI, DefinitionAPI, CommandAPI interfaces.
Hereafter you will find an example on how to use the AccessorUtil class from your client application:
RuntimeAPI runtimeAPI = AccessorUtil.getAPIAccessor().getRuntimeAPI();
QueryRuntimeAPI queryRuntimenAPI = AccessorUtil.getQueryAPIAccessor().getQueryRuntimeAPI();
Note:
- Authentication action has to be performed before getting the API
interface.
- To package and deploy Bonita within the Easybeans EJB 3
container, see the
documentation into the package (you could extrapolate those
instructions to any other JEE application server).
- A complete example (Approval Workflow) illustrating both standard
and enterprise deployments is
provided into the delivered package (available under
Nova_Bonita_Install_Directory/examples/approvalWorkflow).