You are not logged in.
Announcement
Unanswered posts
|
Pages: 1

hi,
i have a child package that needs to check for folders and return these found directories as variables to the parent package, using:
tContextDump -> tBufferOutput
the problem comes when setting the values for these variables.
i have a tJava that sets values for these variables as:
context.variableA = "c:/some_folder/";
i have a tFileExists that checks for the existence of this folder - and returns true
but when using tContextDump this very same variable returns the value <null>
how is that possible.
it seems to be the same issue raised on this other forum topic:
http://www.talendforge.org/forum/viewtopic.php?id=4761
is there some work around this problem???
thanks,
Nicolas
Offline

I can't any more find where I came up with this answer but apparently context values are stored in more than one place and tContextDump picks up only those values defined when the job begins so if you set context values dynamically using tJava you need to follow with the following statement so that tContextDump will use the new values:
context.synchronizeContext();
Offline

Many thanks Alevy,
i will try your suggestion.
Offline
alevy wrote:
I can't any more find where I came up with this answer but apparently context values are stored in more than one place and tContextDump picks up only those values defined when the job begins so if you set context values dynamically using tJava you need to follow with the following statement so that tContextDump will use the new values:
Code:
context.synchronizeContext();
THANKS! I've been going around in circles with this for the last 24 hours.
This needs to be a sticky post - or - better yet - they need to add that one line of code to the tContextDump component.
But, in case someone actually wants it to work that way, just add a Synchronize checkbox to the Basic Settings.
Offline
Thank you very much for that answer, it is 4 hours i am fighting with forwarding context from child to parent and was not able to do it because of that context.synchronizeContext()...
This post should be awarded !
thanks again
Offline
Pages: 1