How to pass the filename from tfileoutputdelimited parent job to tfileinputdelimited child job usning context parameter/variable

Highlighted
Six Stars

How to pass the filename from tfileoutputdelimited parent job to tfileinputdelimited child job usning context parameter/variable

How to pass the filename from tfileoutputdelimited parent job to tfileinputdelimited child job usning context parameter/variable
Hi,

We have a requirement where we want to pass the filename created in the tfileoutputdelimited parent job to the tfileinputdelimited child job. Running the job as independent process run's fine. The issue is when passing the context parameters to the child job.

The child job is a shared job and can be used with other parent jobs. The tFileInput component (child job) is not able to validate the context parameter when  passed in the Filename. I also tried by passing the (String)globalMap.get("xx.context.inputfiletest") in the Filename. No luck. I have attached the screen shot and would appreciate if someone can provide a solution.

Thanks

Highlighted
Community Manager

Re: How to pass the filename from tfileoutputdelimited parent job to tfileinputdelimited child job usning context parameter/variable

So you are loading data from your DB to your tFileOutputDelimited first. Are you trying to load to one file with a preset context variable for the filename? Alternatively are you trying to load into several different files with a filename supplied by the DB? This requires a very different way of working.

 

To supply the tRunJob with context variable values, you can get rid of the tJava. You can use the globalMap values set by the tFlowToIterate directly. Select the context variable within the tRunJob that you wish to use and assign it the globalMap value. The tRunJob must be linked via the iterate link to the tFlowToIterate.

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

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 3

Read about some useful Context Variable ideas

Blog