July 30, 2023

tSetGlobalVar – Docs for ESB 7.x


Facilitates the process of defining global variables.

allows you to define and set global variables in GUI.

tSetGlobalVar Standard properties

These properties are used to configure tSetGlobalVar running in the Standard Job framework.

The Standard
tSetGlobalVar component belongs to the Custom Code family.

The component in this framework is available in all Talend

Basic settings


This table contains two columns.

Key: Name of the variable to be
called in the code.

Value: Value assigned to this

Advanced settings

tStatCatcher Statistics

Select this check box to gather the Job processing metadata at a
Job level as well as at each component level.

Global Variables

Global Variables

ERROR_MESSAGE: the error message generated by the
component when an error occurs. This is an After variable and it returns a string. This
variable functions only if the Die on error check box is
cleared, if the component has this check box.

A Flow variable functions during the execution of a component while an After variable
functions after the execution of the component.

To fill up a field or expression with a variable, press Ctrl +
to access the variable list and choose the variable to use from it.

For further information about variables, see
Talend Studio

User Guide.


Usage rule

This component is generally used as a one-component subJob.


Knowledge of Java language is required.

Printing out the content of a global variable

This scenario is a simple Job that prints out the value of a global variable defined
in the tSetGlobalVar component.


Setting up the Job

  1. Drop the following components from the Palette onto the design workspace: tSetGlobalVar and tJava.
  2. Connect the tSetGlobalVar component to the
    tJava component using a Trigger > OnSubjobOk connection.

Configuring the tSetGlobalVar component

  1. Double-click the tSetGlobalVar component to
    display its Basic settings view.


  2. Click the plus button to add a line in the Variables table, and fill the Key and Value fields with
    K1 and 20 respectively.
  3. Then double-click the tJava component to
    display its Basic settings view.


  4. In the Code area, type in the following

    this use case, we use the Result variable. To access the
    global variable list, press Ctrl + Space bar on
    your keyboard and select the relevant global parameter.

Job execution

Save your Job and press F6 to execute it.

The content of global variable K1 is displayed on the


Document get from Talend https://help.talend.com
Thank you for watching.
Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x