[resolved] accessing value of global variable set by joblet

One Star

[resolved] accessing value of global variable set by joblet

Hi all,
I have global variable. The value was set in joblet.
Now how can I access the value of that global variable in main job? I can see the value in joblet but I get null value in main job
Cheers!

Accepted Solutions
One Star

Re: [resolved] accessing value of global variable set by joblet

Hi Foxtrot,
I am hoping that one of the two below listed will help you out.
-> getting a global value from the map can be done as follows... (String)globalMap.get("globalVariableName"); In this example, the name of the variable is called globalVariableName
and it is a type String. A note that you will need to cast the field to its type.
-> If you set the field as a context type, you can load it and access it via the context variable list. A thought.
My disclaimer... I am new to Talend myself. That said, I have used the above two methods when accessing values.
Regards,
Tom

All Replies
One Star

Re: [resolved] accessing value of global variable set by joblet

Hi Foxtrot,
I am hoping that one of the two below listed will help you out.
-> getting a global value from the map can be done as follows... (String)globalMap.get("globalVariableName"); In this example, the name of the variable is called globalVariableName
and it is a type String. A note that you will need to cast the field to its type.
-> If you set the field as a context type, you can load it and access it via the context variable list. A thought.
My disclaimer... I am new to Talend myself. That said, I have used the above two methods when accessing values.
Regards,
Tom
One Star

Re: [resolved] accessing value of global variable set by joblet

Thanks..it seems that I don't have joblet functionality in community version
Hence, I just used multiple subjobs :-)