Access Bonita 6.* engine from within a distinct tomcat servlet


Hello Bonita people,

I'm running an instance of Bonita on a tomcat 6 and I want for some obscure reason to access my running engine from a custom servlet i set up beside bonita webapp.

My question is: what is the proper way to grant access to the engine for my app ?

I was stating that:

tomcat is starting with the BONITA_HOME environement variable set to my portal bonita_home folder this folder is defining the local API for access local API is well suited for an access made on the same JVM

But what i get as a result is that the login method is throwing a "node not started" exception, which tends to show that i'm not accessing the runing platform.

Any help would be greatly appreciated !

1 answer

This one is the BEST answer!


In your case the proper way to access the engine would be to use the API in HTTP Mode. In your servlet code, before calling any Bonita API you should set the API Mode to HTTP by using this code:

Map<String, String> parameters = new HashMap<String, String>(); parameters.put("server.url", "http://localhost:8080"); parameters.put("", "bonita"); APITypeManager.setAPITypeAndParams(ApiAccessType.HTTP, parameters);

The application name is the context name of your bonita web app.

Hope it helps. Cheers, Lionel


Submitted by aCordier on Wed, 04/23/2014 - 15:59

It does help.

Resolved, thanks.