Unable to get globalvaraible value in tjava

Highlighted
Five Stars

Unable to get globalvaraible value in tjava

Hi People,

I am newbie to talend...and was trying out to build a job....

My requirement is

tRowGenerator >>   Row1>>tSetGlobalVariable>>row2>>tJava

I have generated one random field called name using TalendData.getname() function. E.g (Aarya)

 

in tSetGlobalVariable

For Parameter "myKey"

Value " (String)globalMap.get(row1.name)"

 

In tjava

System.out.println("myKey")

 

unfortunately I output as myKey and I expect Aarya.

 

Can some one explain what am I doing wrong?

 

Tags (1)
Forteen Stars

Re: Unable to get globalvaraible value in tjava

Hi

 

it looks like you do wrong, check for begin some information here - https://help.talend.com/reader/KxVIhxtXBBFymmkkWJ~O4Q/yjzLPbgCOJF~YJGNskhmMQ

 

you do not need to use (String)globalMap.get(row1.name) in tSetGlobalVar, but need when use it

System.out.println((String)globalMap.get("mykey"))

 

for assign row1 to variables - check documentation about tFlowToIterate - it do this for you

-----------

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch

Downloads and Trials

Test drive Talend's enterprise products.

Downloads