new user - tcontextload not updating context variable

One Star

new user - tcontextload not updating context variable

Hello,
I am using a context variable to dynamically update the output directory in a toutputfiledelimineted node. I am using tcontextload to update the context variable. I have the tables set correctly and the run window says:
tContextLoad set key employer_id with value 'C:\users\mvucovich\desktop\test_out.csv'
However the file is written to the path set as the default for that context variable, not the directory above. I'm quite confused because it appears that the context variable (employer_id) has been updated according to the log, but is not actually passing the value.
I am running Windows 7.
Thanks,
Michael
Community Manager

Re: new user - tcontextload not updating context variable

Hello Michael
Can you upload some screenshots of your job?
You should load the value before other transcation, eg:
tFileInputDelimited_1---tContextLoad
|
onsubjobok
|
tFileInputDelimited_2----tFileOutputDelimited

Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: new user - tcontextload not updating context variable

Sure, see below. Thanks for the reply.
This is just a test job I am using to understand the functionality. The default context remains active even though the log pane says its been updated.
Thanks,
Michael
Community Manager

Re: new user - tcontextload not updating context variable

Hello
The default context remains active even though the log pane says its been updated.

The default value in context tab will never changed unless you change it manually, the value of context is changed at the runtime, if you print the context value on tPerlRow, you will see it output the new vlaue.
Best regards
shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: new user - tcontextload not updating context variable

Thanks--

I'm confused--if tcontextload is saying that the context has been updated to reflect a new value (i use the print option), why would that value not be actually used in the toutputdeliminated node? I'm not trying to change the default value itself, I'm trying to use a different value in the job itself, dynamically set by the tcontextload node.
Could it be the case that context variables updated in the job do not apply to toutputdeliminated nodes?
The screenshots below are out of order (couldn't figure that out), but show:
the job execution--you can see that the default context contains a filepath that is different from the one updated by context load (in the run window).
the configuration of the toutputdeliminated node
the resulting file written to the desktop (which is not the name of the file in the updated context).
Community Manager

Re: new user - tcontextload not updating context variable

Hello
As I said before, you should load the value before other transcation, eg:
tFileInputDelimited_1---tContextLoad
|
onsubjobok
|
tFileInputDelimited_2----tFileOutputDelimited
why you still get the default value in your job? In the generated code, the file name is defined with default value before tFileIndelimited begin to works. You can read the documentaiton https://help.talend.com/reader/QDC7DnW3S_chYXXornFuGw/3QRqVgh0vXKx3BPeUidHZw to know the generated code model.
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business