Configuring the tSetGlobalVar component - 6.4

Global variable

author
Talend Documentation Team
EnrichVersion
6.4
EnrichProdName
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for ESB
Talend Open Studio for MDM
Talend Real-Time Big Data Platform
task
Data Governance > Third-party systems > Custom code components (Integration) > Global variable components
Data Quality and Preparation > Third-party systems > Custom code components (Integration) > Global variable components
Design and Development > Third-party systems > Custom code components (Integration) > Global variable components
EnrichPlatform
Talend Studio

Procedure

  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 lines:
    String foo = "bar";
    String K1;
    String Result = "The value is:";
    
    Result = Result + globalMap.get("K1");
    
    System.out.println(Result);
    
    
    In 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.