Exec

Exec object is used for executing a scripting service programmatically.

Basic Usage

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* globals $ */
/* eslint-env node, dirigible */

var exec = require('platform/exec');
var response = require('net/http/response');

var context = {"input_param": "input_param_value"};

// Test execution
var result = exec.test("/platform/exec_target_test.js", context);

response.println("Printing output parameter: " + result.context.output_param);

// use also exec.js(), exec.flow(), exec.job(), exec.sql(), exec.command() ...

response.flush();
response.close();

Definition

Functions


Function Description Returns
js(path, context) Executes the given JavaScript service by path the resulting context object
test(path, context) Executes the given JavaScript test case by path the resulting context object
flow(path, context) Executes the given Flow service by path the resulting context object
job(path, context) Executes the given Job service by path the resulting context object
sql(path, context) Executes the given SQL service by path the resulting context object
wiki(path, context) Executes the given JavaScript transformer by path the resulting context object
command(path, context) Executes the given shell Command service by path the resulting context object

Compatibility

Rhino Nashorn V8
βœ… βœ… ❌
Edit