JavaScript Evaluator

Supported pipeline types:
  • Data Collector

  • Data Collector Edge

The JavaScript Evaluator processor uses JavaScript code to process data. Use the JavaScript Evaluator processor to use JavaScript code to perform custom processing.
You can develop the following scripts for the processor:
  • Initialization script - Optional initialization script that sets up any required resources or connections. The initialization script is run once when the pipeline starts.
  • Main processing script - Main script that processes data. The main script is run for each record or each batch of data, based on the configured processing mode.
  • Destroy script - Optional destroy script that closes any resources or connections that were opened by the processor. The destroy script is run once when the pipeline stops.

When you use a JavaScript Evaluator processor in a pipeline, Data Collector passes a batch of data to the processor and converts the data to a scripting-friendly data structure for processing.

You can call external Java code from the script. The JavaScript Evaluator processor supports Java version 8u40 and later and ECMAScript version 5.1. The processor runs on the Nashorn JavaScript engine.

The JavaScript Evaluator processor provides extensive sample code that you can use to develop your script.

When configuring the processor, you specify the processing mode, enter the scripts, and specify the method to access records and any script parameters used in the script.