Unable to get globalvaraible value in tjava

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)
Highlighted
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

-----------

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Have you checked out Talend’s 2019 Summer release yet?

Find out about Talend's 2019 Summer release

Blog

Talend Summer 2019 – What’s New?

Talend continues to revolutionize how businesses leverage speed and manage scale

Watch Now

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog