API: engines
Source:
platform/engines.ts
Interface defining the execution parameters expected by the Engine class.
Usage
import { Engine } from "sdk/platform";
import { response } from "sdk/http";
let result = new Engine("javascript").execute("project1", "hello.js", "", {});
response.println(JSON.stringify(result));
response.flush();
response.close();Classes
Engine
@class Engine
@description Represents a specific execution engine type (e.g., JavaScript, Groovy)
and provides methods to interact with the platform's execution facade.
Methods
getTypes
getTypes ():string[]Retrieves the list of available engine types from the platform.
@returns {string[]} An array of supported engine type names.
execute
execute (projectName:string, projectFilePath:string, projectFilePathParam:string, parameters:ExecutionParameters, debug:boolean=false):anyExecutes a project script or process using the configured engine type.
@param {string} projectName The name of the project.
@param {string} projectFilePath The relative path to the main file to execute within the project (e.g., "lib/script.js").
@param {string} projectFilePathParam A secondary file path parameter (often unused or context-specific).
@param {ExecutionParameters} parameters An object containing key/value parameters to pass to the script context.
@param {boolean} [debug=false] Whether to execute in debug mode.
@returns {any} The result returned by the executed script.