Nova Bonita RC2 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 reached it remotely thanks to the Workflow Session Beans APIs.
The java APIs can be accessed thru an API accessor object as described in the example below:
APIAccessorImpl accessor = new APIAccessorImpl(); RuntimeAPI runtimeAPI = accessor.getRuntimeAPI(); QueryAPIAccessorImpl accessorQ = new QueryAPIAccessorImpl(); QueryRuntimeAPI queryRuntimeAPI = accessorQ.getQueryRuntimeAPI();
There are 2 different accessor interfaces available:
QueryAPIAccessor: to get access to QueryRuntimeAPI QueryDefinitionAPI interfaces.
APIAccessor: to get access to getRuntimeAPI, ManagementAPI, DefinitionAPI, CommandAPI interfaces.
APIAccessorImpl and QueryAPIAccessorImpl classes are implementing the two interfaces. Instantiation of these classes gives access to the expected bonita API.
The session Bean APIs can be accessed by simply executing a lookup on the expected API interface. The jndi name is the name of the java interface:
RuntimeAPI runtimeAPI = (RuntimeAPI) initialContext.lookup("runtimeAPI"); QueryDefinitionAPI queryDefinitionAPI = (QueryDefinitionAPI) initialContext.lookup("QueryDefinitionAPI ");
An utility class has been provided to unify access to Bonita APIs and 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.
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","auto-detect",''ejb2" and "ejb3").
Hereafter you will find an example on how to use the Accessorutil class from your client application:
RuntimeAPI runtimeAPI = AccessorUtil.getRuntimeAPI(); QueryDefinitionAPI queryDefinitionAPI = AccessorUtil.getQueryRuntimeAPI();