Model
The constructor creates a new Model object.
public Model ( String host,
String port)
Parameters:
List
Lists the models that the user (as indicated by the current set of properties) is allowed to access.
public boolean List ()
throws Exception
public boolean List (
String pattern)
throws Exception
Parameters:
Returns:
false if the function failed. In that case the Info file contains XML error data. If the function succeeds it returns false, and the Info file contains a list of models.
Start
The RunModel functionality is split in two method calls: Start and Continue. Start must always be called first. Depending on the outcome of the previous call, zero or more Continue calls will be needed.
public int Start (
String model,
String result,
String keys,
String extras)
throws Exception
public int Start (
String model,
String result,
String keys,
String extras,
String preCMD,
String postCMD,
String onSuccessCMD,
String onFailureCMD)
throws Exception
Parameters:
Note
The api user should be aware that this Pre command is executed when the model needs to get data from the database. If the model is set up in such a way that interact statements follow on this data access, the pre command will be executed the first time the data is accessed and every time the Continue call is called.
Note
The API user should be aware that this Post command is executed after every run of the model. This means that the Post command is executed for the Start call and all its Continue calls.
Return:
Continue
If Start(), or another Continue() call have returned ModelResultInteract, and the user has been prompted to provide answers to the interact questions, Continue() can be called to continue model execution.
public int Continue (
String response,
String submission)
throws Exception
Parameters:
public boolean Finish ()
throws Exception
Upload
This method will send the file indicated by the filename argument to ITP/Server. The file will be stored under an automatically generated unique name in the session directory on the server. The server-side name will be returned as the return value of this call as a "file:<name>" URI. The name is a relative path w.r.t. the session directory on the server. If the call fails, an empty string will be returned and the info file will contain additional error data.
The stored files will at least remain present at the server until Finish is called.
Upload will only work as long as a session id is present, i.e. between calls of Start and Finish.
public String Upload (
String filename)
throws Exception
Parameters:
Returns:
Local name on the server, empty string on error.