Updated on 2022-02-22 GMT+08:00

Expression Overview

Node parameter values in a Data Development job can be dynamically generated based on the running environment by using Expression Language (EL). EL uses simple arithmetic and logic to calculate and references embedded objects, including job objects and tool objects.

Job object: provides properties and methods of obtaining the output message, job scheduling plan time, and job execution time of the previous node in a job.

Tool job: Provides methods of operating character strings, time, and JSON. For example, truncating a substring from a string or formatting time.

Syntax

Expression syntax:

#{expr}

In the preceding information, expr indicates an expression. # and {} are common operators used in EL, allowing you to access job properties using embedded objects.

Example

In the URL parameter of the Rest Client node, use expression tableName=#{JSONUtil.path(Job.getNodeOutput("get_cluster"),"tables[0].table_name")}, as shown in Figure 1.

Expression description:

  1. Job.getNodeOutput("get_cluster") is used to obtain the execution result of the get_cluster node in the job. The execution result is a JSON character string.
  2. tables[0].table_name is used to obtain the value of a field in the JSON character string.
Figure 1 Expression example