CX_WEB_SERVICE_MANAGER::LaunchDedicatedClassiX
4.1.0
204939
Description:
This method instructs the connected MorphIT server to start a new ClassiX process with the specified parameters on the specified launcher instance. For this to work, the following conditions must be met:
- The ClassiX is connected to the server(HasMorphITConnection = TRUE)
- A MorphIT-Launcher is running under the specified IP/host name and is connected to this MorphIT server
- The MorphIT launcher has enough free capacity to launch an instance
- A valid start nonce is transferred, which was delivered by the server via RequestMorphITBinding.
If the start fails, this call will fail with a corresponding error message. Otherwise the process ID of the started process is returned. As the process is started via CMD /C, the process ID corresponds to the process ID of the cmd process and not to the actual ClassiX instance. So the value only serves as confirmation that a process has been started on the Launcher.
The initial configuration is an optional CX_JSON_OBJECT with two fields:
- env - An object that defines the additional environment variables to be set. {name:value, name2:value2, ...}
- cwd - A string that specifies the working directory with which the command should be started. (Default: ws.launcher.launch.cwd - from the config.js)
The start command is a string which is passed on to CMD /C "...".
Code example:
Start a dedicated ClassiX as a web service instance via the launcher.
LAUNCH_INSTANCE_POST: { LocalVar(endpoint, response) GetManager(WEB_SERVICE) CallWeak(RequestMorphITBinding) -> endpoint endpoint ifnot { //TODO pass error back to the user } launcherHostName "CX_MORPHIT_NONCE" SystemObject Call(GetEnvironment) startCommand NULL GetManager(WEB_SERVICE) CallWeak(LaunchDedicatedClassiX) ifnot { //TODO pass error message back to the user } CreateTansObject(CX_JSON_OBJECT) -> response "dynamic" response Put(type) endpoint response Put(endpoint) response ReturnStack }
Stack | Position | Object type | Brief description |
---|---|---|---|
Stack(In) | Top | CX_WEB_SERIVCE_MANAGER | The Web Service Manager |
Top 1 | CX_JSON_OBJECT | ZERO | Start configuration | |
top 2 | STRING | Start command | |
top 3 | STRING | Start nonce value | |
top 4 | STRING | Hostname/IP of the Launcher | |
Stack(Out) | Top | INTEGER | Process ID of the started process |