Execute Javascript Action
Execute JavaScript Action enables the execution of JavaScript code via Nashorn, unlocking a wide range of possibilities. Its primary purpose is to facilitate integration with third-party systems for which MoovIT GmbH has not yet provided dedicated action nodes. If you require assistance, please contact us.
Nashorn Overview and Limitations Nashorn is the JavaScript engine included with Oracle’s Java 8–14 releases. It implements ECMAScript 5.1 and offers partial support for some ECMAScript 6 features, allowing Java applications to run JavaScript scripts on the JVM. However, Nashorn has several limitations to consider when using it within Execute JavaScript Action:
ECMAScript Support • Supports ECMAScript 5.1 fully, but only a subset of ECMAScript 6 (for example, limited support for arrow functions and template literals). Many modern JavaScript language features—such as classes, modules, and newer syntax introduced in ES2017+—are not supported.
Performance Considerations • Nashorn compiles scripts to bytecode at runtime, which can introduce a slight startup delay when loading large or complex scripts. For long-running integrations, this overhead is usually negligible, but you should profile performance if execution speed is critical.
Limited Browser API Support • Nashorn does not emulate browser-specific APIs (e.g.,
window
,document
, or DOM manipulation). Any script relying on browser globals must either be adapted to use pure JavaScript logic or augmented with custom Java-side shims.
Example javascript nashorn code which returns the result via the wildcard stream.last_result or node result
var myInput = "test1234";
var myOutput = myInput;
myOutput;
Last updated