The Liquit.Applications.Launch function is used to launch applications from the Application Workspace API. The applications return a callback reporting on their status: if the application has been launched successfully or not, or a status update on the progress. The update on the progress comes especially in handy when running installations or distributions.
Return parameters
The status callback property can be as follows:
Name | Description | Value |
---|---|---|
success | Application has launched successfully | String |
failure | Application has failed to start. See the details property for more information about the error. | String |
inprogress | Application is being installed. Check the progress property to see how far along the installation is. | String |
The details property is available only when an application has failed to launch. It reports the exact reason why an application failed to launch.
The progress property is available only when an application is in progress. It reports the progress in percentage (0-100).
Example
// Launch application by ID with callback returning progress information.
Liquit.Applications.Launch(id, null, function (e) {
console.log(e);
// *** e.state ***
// Can be one of the following values:
//
// * 'success': The application has been successfully launched.
// * 'inprogress': The application is being installed. Check the progress property to see how far along the installation is.
// * 'failure': The application has failed to start. See the details property for more information about the error.
//
// *** e.progress ***
// Gives an estimated percentage of the installation progress.
//
// *** e.details ***
// Gives additional information about the failure to launch the application.
// This is structured with a 'code' field and a 'message' field describing the error.
//
// Application started
if (e.state == 'success')
alert('application started');
// Failed to start application.
else if (e.state == 'failure')
alert('application failed to start: ' + e.details.code + ': ' + e.details.message);
});