Bonita.home

*** When i am trying to execute my java class contains the:

import org.bonitasoft.engine.api.PlatformAPI;
import org.bonitasoft.engine.api.PlatformAPIAccessor;
import org.bonitasoft.engine.api.PlatformLoginAPI;
import org.bonitasoft.engine.exception.BonitaException;
import org.bonitasoft.engine.exception.BonitaHomeNotSetException;
import org.bonitasoft.engine.exception.ServerAPIException;
import org.bonitasoft.engine.exception.UnknownAPITypeException;
import org.bonitasoft.engine.session.PlatformSession;

public class Platform {
public static void main(String args) throws BonitaException, ServerAPIException, Exception {
// TODO Auto-generated method stub

	PlatformLoginAPI platformLoginAPI = PlatformAPIAccessor.getPlatformLoginAPI();
	
	PlatformSession platformSession = platformLoginAPI.login("platformAdmin", "platform"); 
	
	
	// Get the platform API 
	PlatformAPI platformAPI = PlatformAPIAccessor.getPlatformAPI(platformSession);
	
	// create the platform 
	platformAPI.createPlatform();
	
	// initialize the platform 
	platformAPI.initializePlatform(); 
	
	// start the execution engine 
	platformAPI.startNode(); 
	
}

}

ERROR*********

Exception in thread “main” org.bonitasoft.engine.exception.BonitaHomeNotSetException: You need to set the system property: bonita.home
at org.bonitasoft.engine.home.BonitaHome.getBonitaHomeFolder(BonitaHome.java:34)
at org.bonitasoft.engine.home.BonitaHomeClient.getBonitaHomeClientFolder(BonitaHomeClient.java:42)
at org.bonitasoft.engine.util.APITypeManager.getProperties(APITypeManager.java:77)
at org.bonitasoft.engine.util.APITypeManager.getProperty(APITypeManager.java:72)
at org.bonitasoft.engine.util.APITypeManager.getAPIType(APITypeManager.java:45)
at org.bonitasoft.engine.api.PlatformAPIAccessor.getServerAPI(PlatformAPIAccessor.java:46)
at org.bonitasoft.engine.api.PlatformAPIAccessor.getPlatformLoginAPI(PlatformAPIAccessor.java:80)
at Platform.main(Platform.java:15)
Picked up _JAVA_OPTIONS: -Xmx512M

Hi,

you need to define a system property or a program property named bonita.home that contains the path of your folder containing the bonita home.
If you don’t have a bonita home, you need to download it.

Best regards,
Céline

Hi Céline,

Do you mean to say that in :Environment Variable in ClassPath we need to define:

bonita.home

value:Path of the BonitaSoft Folder.Folder is that the:Path of the

C:\BonitaBPMCommunity-6.3.3

where it has the Workspace,plugin and Configuration Folder has.

Or …Please give me a example with the Folder Path…

Thanks and Regards

Tonmoy garg

Hi,

The Bonita home is a component of Bonitasoft. You can find it on a bundle of Bonitasoft. It’s the folder named “bonita”.

The example to define your bonita home :

-Dbonita.home=${workspace_loc:my_project}\target\bonita

If you use Eclipse, put this on “Arguments” > “VM Arguments” (Change the name of the project).

Regards
Céline