Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Job Embedded Objects

Updated on 2024-08-30 GMT+08:00

A 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.

Properties and Methods

Table 1 Property description

Property

Type

Description

name

String

Job name.

planTime

java.util.Date

Job scheduling plane time, that is, the time configured for periodic scheduling, for example, to schedule a job at 1:01 a.m. every day.

startTime

java.util.Date

Job execution time. It may be the same as or later than the planTime (because the job engine is busy).

eventData

String

Message obtained from the stream when the event-driven scheduling is used.

projectId

String

ID of the project where the DataArts Factory module is located.

Table 2 Method description

Method

Description

Example

String getNodeStatus(String nodeName)

Obtains the running status of a specified node. If the node runs properly, success is returned. If the node fails to run, fail is returned.

For example, to check whether a node is running successfully, you can use the following command, where test indicates the node name:

#{(Job.getNodeStatus("test")) == "success" }

Obtains the running status of the test node:

#{Job.getNodeStatus("test")}

String getNodeOutput(String nodeName)

Obtains the output of a specified node. This method can only obtain the output of the previous dependent node.

  • Obtains the output of the test node:

    #{Job.getNodeOutput("test")}

  • If the previous node has no execution result, the output is null.
  • If the output of a node is a field, the output result is in the format like [["000"]]. In this case, you can use the EL expression to split the string result and obtain the field value output by the previous node. Note that the output result type is string. If you want to output the original data type, you need to use the EL expression of the For Each node and the loop embedded objects supported by the node.

    #{StringUtil.split(StringUtil.split(StringUtil.split(Job.getNodeOutput("Name of the previous node"),"]")[0],"[")[0],"\\"")[0]}

  • If the output of a node contains two or more fields, the output result is in the format like [["000"],["001"]]. In this case, you need to obtain the output result using the EL expression of the For Each node and the loop embedded objects supported by the node, for example, #{Loop.current[0]}.

String getParam(String key)

Obtains job parameters.

This method only obtains the parameter values configured for the current job, but not parameter values passed from the parent job or the global variables configured for the workspace.

To obtain the parameter values passed from the parent job and the global variables configured for the workspace, you are advised to use the ${job_param_name} expression.

Obtains the value of the test parameter:

#{Job.getParam("test")}

String getPlanTime(String pattern)

Obtains the plan time character string in a specified pattern. Pattern indicates the date and time mode. For details, see Date and Time Mode.

Obtains the planned job scheduling time, which is accurate to millisecond:

#{Job.getPlanTime("yyyy-MM-dd HH:mm:ss:SSS")}

String getYesterday(String pattern)

Obtains the time character string of the day before the plan time. Pattern indicates the date and time mode. For details, see Date and Time Mode.

Obtains the time on the previous day of the planned job scheduling time, which is accurate to date:

#{Job.getYesterday("yyyy-MM-dd HH:mm:ss:SSS")}

String getLastHour(String pattern)

Obtains the time character string of last hour before the plan time. Pattern indicates the date and time mode. For details, see Date and Time Mode.

Obtains the time one hour before the planned job scheduling time, which is accurate to hour:

#{Job.getLastHour("yyyy-MM-dd HH:mm:ss:SSS")}

String getRunningData(String nodeName)

Obtains the data recorded during the running of a specified node. Currently, only the IDs of the jobs running using SQL statements on the DLI SQL node can be obtained. This method can only obtain the output of the previous dependent node.

For example, to obtain the job ID of the third statement on DLI node DLI_INSERT_DATA, run the following command: #{JSONUtil.path(Job.getRunningData("DLI_INSERT_DATA"),"jobIds[2]")}.

Obtains the ID of the job run by the third statement in the test of the DLI SQL node:

#{JSONUtil.path(Job.getRunningData("test"),"jobIds[2]")}

String getInsertJobId(String nodeName)

Returns the job ID in the first Insert SQL statement of the specified DLI SQL or Transform Load node. If the nodeName parameter is not specified, the job ID in the first DLI Insert SQL statement of the DLI SQL node is obtained. If the job ID cannot be obtained, the null value is returned.

Obtains the ID of job run by the first Insert SQL statement in the test of the DLI SQL node:

#{Job.getInsertJobId("test")}

String getPreviousWorkday(Integer num, String pattern)

Returns the time string of the num working day before a planned time specified by pattern. The value of num must be a positive integer. If no result that meets the specified condition is found, null is returned.

This EL expression is suitable for selecting custom dates in a calendar to schedule jobs.

Obtain the date of the fifth working day before a specified job scheduling day.

#{Job.getPreviousWorkday(5, "yyyyMMdd")}

String getPreviousNonWorkday(Integer num, String pattern)

Returns the time string of the num non-working day before a planned time specified by pattern. The value of num must be a positive integer. If no result that meets the specified condition is found, null is returned.

This EL expression is suitable for selecting custom dates in a calendar to schedule jobs.

Obtains the date of the first non-working day before a specified job scheduling day.

#{Job.getPreviousNonWorkday(1, "yyyyMMdd")}

Example 1

The expression used to obtain the output of node test in the job is as follows:

#{Job.getNodeOutput("test")}

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback