Skip to main content

JavaScript Stages Variables and Parameters

JavaScript is a lightweight scripting language. The JavaScript in a JavaScript stage is standard ECMAScript. What a JavaScript program can do depends on the container in which it runs. For a JavaScript Query stage, the container is a Fusion query pipeline. The following global pipeline variables are available:

Syntax Variants

JavaScript stages are written using function syntax, which passes variables as function parameters.

Function Syntax

ImportantFunction syntax is used for the examples in this document.

Global variable logger

The global variable named logger writes messages to the log file of the server running the pipeline. This variable is truly global and does not need to be declared as part of the function parameter list. There are 5 methods available, which each take either a single argument (the string message to log) or two arguments (the string message and an exception to log). The five methods are, “debug”, “info”, “warn”, and “error”.