I try to start a Process with JAVA-API. But do not succeed. Login and Counting Objects works great, but I don't know how to execute a process.
Does someone has a clue ?
Regards
Here is my sample code:
Code: Select all
public class ExecuteTM1Process {
public static void main(String[] args) {
TM1Val bool;
// TODO Auto-generated method stub
int port = 5498;
int port2 = 5495;
String sHostname="myhost";
String sTM1Server="myserver";
TM1Bean bean = new TM1Bean();
TM1Server tm1serv = new TM1Server();
bean.setAdminHost( sHostname );
bean.setAdminPort( port );
//bean.openCAMConnectionWithNamespace();
tm1serv = bean.openConnection (sTM1Server, "admin", "");
TM1Process tm1p=tm1serv.getProcess("TEST_PROCESS");
if (tm1p.isError()){
System.out.println (tm1p.getErrorMessage()); // DOESN'T GO THROUGH HERE, SO THE PROCESS TEST_PROCESS IS AVAILABLE
}else{
bool = tm1serv.getProcess("TEST_PROCESS").check();
System.out.println( bool.getErrorMessage()); / NO ERROR
tm1p.execute(new TM1Val("true")); // HOW CAN I START A PROCESS
}
System.exit(1);
}
}