One Star

Context load dynamically.

Hi
I have the following requirement.
I want to load the context from the file dynamically when the job starts.
And on top of it I want to pass the location of the file which has the context variables when I run my job.
Is it possible to pass a run time parameter ?
9 REPLIES
Community Manager

Re: Context load dynamically.

Hello
please download the user documentation and see the scenario about tContextLoad component.
Feel free to post your question!
Best regards
shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Context load dynamically.

Hi,

use the extra on the job seting with implicite tContextLoad and chose the file ou database with ccontext Variable (key;value)

jeremie
One Star

Re: Context load dynamically.

which talend job version is this feature present in ?
And is it possible to dump dynamically generated values using tcontextDump?
Because i tried this and it din work ..... the file did not save the value if the context which i had set dynamically using tJava......... only the pre configured contexts were saved
One Star

Re: Context load dynamically.

Hi
Thanks for all the replies
Shong thanks for the reply. In fact I have gone through the user document for tContextLoad.
I am able to load the context dynamically from the file.
Firsy componenet is tFileinputDelimited and second is the tcontextLoad which loads the context from the file specified in the first component.
But my problem is not only the context even the file localtion for tFileInputDelimited should also feed by the user.
May I know is it possible to do this?

cheers
saroj
Community Manager

Re: Context load dynamically.

Hello
But my problem is not only the context even the file localtion for tFileInputDelimited should also feed by the user.
May I know is it possible to do this?

How do you get the feed data from your user? database? file?
Best regards

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

Re: Context load dynamically.

It is going to run background job where it will load the context from file and do some database replication,
So the background job run it via .sh script..
One Star

Re: Context load dynamically.

Use the tSystem function to extract values from a shell script (outout set to normal) pass the output of this to a tMap to create the key, value pairs and then pass the output of this to the tContextLoad. The tSystem calls a simple shell script which returns delimited pairs of values. The tMap then breaks this up by split the string (probably a better way of splitting the string). Simple yet effective for us.
One Star

Re: Context load dynamically.

Hi,
Is somebody can put the link of the user document for tContextLoad?
I don't find it.
Community Manager

Re: Context load dynamically.

Hello
Is somebody can put the link of the user document for tContextLoad?

it is introduced on page 529-531 on Components_RG_31a_EN.pdf.
Best regards

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