6.2.2. Nova Bonita APIs, playing with !

Nova Bonita RC1 is an extensible and embeddable workflow solution that can be easily deployed in both standard (JSE) and Enterprise (JEE) environments.

6.2.2.1. Nova Bonita as a java workflow library in your application

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.

There is also an utility class called AccessorUtil (under the org.ow2.bonita.util package) that allows developers to directly get the APIs in both standalone or Session Bean modes. You will find a sample application leveraging this API under the /examples directory

6.2.2.2. Nova Bonita as a remote workflow server

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 ");
      
For a detailed insight on Nova Bonita APis, please take a look to the Nova Bonita javadoc