I’ve used Bonita so time ago… but now I’ve trying some, that I dont know how to do. I’m using version 5.10.
Well, I explain my goal:
I’ve developed a JAVA webapp, that is a simple form where users insert some information. When user submit the form, I save the information at a database, and at this moment, I want connect with the Bonita Engine to run a process with some vars from application.
I’ve read many links and doc about Bonita APIs, but I dont know exactly how do it…
So basically on v5 what you would like is to include Bonita client dependency in your application (use Maven for that) and add this kind of Java code to your application:
// Type of API to use. If
System.setProperty(BonitaConstants.API_TYPE_PROPERTY, org.ow2.bonita.facade.Context.Standard.toString());
I have add “bonita-client-5.10.jar” to my project.
And this is my code to try to connect with the Bonita Engine:
final ManagementAPI managementAPI = AccessorUtil.getManagementAPI();
final RuntimeAPI runtimeAPI = AccessorUtil.getRuntimeAPI();
final QueryRuntimeAPI queryRuntimeAPI = AccessorUtil.getQueryRuntimeAPI();
final LoginContext loginContext = new LoginContext("Bonita", new SimpleCallbackHandler("admin", "xxxxxx"));
loginContext.login();
But when try to initialize managementAPI. I have the next error
Did you also add all Bonita Client dependencies to your project?
You also need to define the JVM system property BONITA_HOME with full path to your BONITA_HOME folder.
Bonitasoft empowers development teams with Bonita, the open-source and extensible platform to solve the most demanding process automation use cases. The Bonita platform accelerates delivery of complex applications with clear separation between capabilities for visual programming and for coding. Bonita integrates with existing solutions, orchestrates heterogeneous systems, and provides deep visibility into processes across the organization.