How to export a Job from Talend Studio in XML format?

One Star

How to export a Job from Talend Studio in XML format?

Hi All,
My requirement is to export the job created in Talend in XML format, so that we can re run the job by modifying the created job.
In Informatica Power Center it is possible.
Please provide the way to to the same thing in Talend.
Thanks
Sixteen Stars

Re: How to export a Job from Talend Studio in XML format?

Right click on the job and click "Export Items". This export will dump the jobs into .item, .properties and .screenshot files (all are necessary). The .item files are actually XML files which contain the details of the components within the job. I'm not sure what you mean by "so that we can re run the job by modifying the created job" though. I would not recommend altering the files without a lot of research into how they work. It will not be supported. However, you can derive a lot of useful information from those documents by parsing them with other Talend jobs.
One Star

Re: How to export a Job from Talend Studio in XML format?

Hi Rhall
I would explain you the scenario. There are few one to one mappings to be done. It is just a data dump from the source to the target. So if we go manually, then the number of mappings to be created would be equal to number of tables.
Since it is an one to one mapping, with only changes might be related to data types, we would like to create one mapping, then export the job meta data in XML format, and modify it using scripts, so that we do not have to create n number of mappings.
Please give your suggestions on the same.
Thanks
Sixteen Stars

Re: How to export a Job from Talend Studio in XML format?

Your idea *might* work, but if I am honest I reckon that it would be quicker to create the mappings. The reason is that the .item files are tightly linked to the project. If you manually update these (which is not advised) then they can get out of sync which will prevent the job from opening. If you have the Enterprise Edition, you can try editing the "Jobscript" code (in a tab in the bottom left of the workspace). That is json code and might be easier to attempt to edit without destroying the original job. 
You have to remember that Talend is a java source generation tool. It generates the code based on the .item file XML. This is incredibly intricate and will arguably take you longer to master than simply generating your schemas from your databases, dragging in the DB objects and connecting them. Given the source and target tables are the same it would take about 10 seconds per source and target table to drag them in and hook them up.  
Six Stars

Re: How to export a Job from Talend Studio in XML format?

I would suggest trying to use a bulkloader that works as long as the source file fits the destination table. This way you can loop over a set of tables and dump them using a dynamic schema to write the files, and then bulk load them even if they have different schemas as long as they fit the target (this depends on what database you are using but for MSSQL "bcp" will work, or "nzload" for Netezza, etc)