Hello,
I am very new to Bonita.
I am trying to implement a Bonita process into a Java EE Application and deploy it to the Bonita Wildfly.
I have found the simple Example that connects to the running Bonita instance but when I deploy it as an ear file to my wildfly instance nothing happens. I cant see any output logs. Thats why I am curious if my Program is even running.
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.bonitasoft.engine.api.ApiAccessType;
import org.bonitasoft.engine.api.IdentityAPI;
import org.bonitasoft.engine.api.LoginAPI;
import org.bonitasoft.engine.api.TenantAPIAccessor;
import org.bonitasoft.engine.identity.RoleSearchDescriptor;
import org.bonitasoft.engine.identity.User;
import org.bonitasoft.engine.identity.UserCriterion;
import org.bonitasoft.engine.identity.UserSearchDescriptor;
import org.bonitasoft.engine.search.SearchOptionsBuilder;
import org.bonitasoft.engine.search.SearchResult;
import org.bonitasoft.engine.session.APISession;
import org.bonitasoft.engine.util.APITypeManager;
public class ProcessDeployer {
public static void main(final String args[]) {
final Logger logger = Logger.getLogger("TestUserList");
try {
final Map map = new HashMap();
map.put("server.url", "http://localhost:8080");
map.put("application.name", "bonita");
APITypeManager.setAPITypeAndParams(ApiAccessType.HTTP, map);
// Set the username and password
final String username = "William.Jobs";
final String password = "bpm";
// get the LoginAPI using the TenantAPIAccessor
final LoginAPI loginAPI = TenantAPIAccessor.getLoginAPI();
// log in to the tenant to create a session
final APISession session = loginAPI.login(username, password);
// get the identityAPI bound to the session created previously.
final IdentityAPI identity = TenantAPIAccessor.getIdentityAPI(session);
// get the list of users
final List user = identity.getUsers(0, 30, UserCriterion.FIRST_NAME_ASC);
// display the list of userNames
for (int i = 0; i < user.size(); i++) {
System.out.println(((User) user.get(i)).getFirstName());
}
loginAPI.logout(session);
} catch (final Exception e) {
logger.log(Level.SEVERE, "ERROR RETRIEVING USERS", e);
}
}
}
This is what I have in my Maven Project. I want to build a Process and orchestrate it from my Java classes like Camunda. Is this even possible.
Thanks in Advance.