In order to run a procedure you will need to open a reference to the specific procedure, MainExecution in this case.
IProcedure procedure = session.openProcedure("MainExecution");
Running a procedure that does not require arguments is quite straightforward:
IProcedure procedure = session.openProcedure("MainExecution"); procedure.run();
Close the procedure after usage:
procedure.close();
The run method will block until AIMMS has finished execution of the specified procedure. Optionally, you can specify a timeout value as first argument. This value denotes the amount of time a procedure execution may take before an AM_Communication error is raised.
The Procedure with arguments example shows you how to run procedures with one or more arguments.