Post a reply

Write your message and submit

Options

Click in the dark area of the image to send your post.

Go back

Topic review (newest first)

brunogirin
2010-02-22 11:10:24

@shong: thanks for your reply.

I had indeed worked out that I needed to create the XML file first before using the tAdvancedFileOutputXML task with the "append" option checked. I've now got the main job working by creating a skeleton XML file by hand prior to running the job but obviously having to manually create this skeleton file defeats the purpose of using a tool like Talend. Is there any way to include a task somewhere in order to do that? Topic #5975 that you mention doesn't say anything about it.

shong
2010-02-22 04:03:10

Hello

Exception in component tAdvancedFileOutputXML_1
java.lang.Exception: can not find the file:/home/bruno/TOS-All-r31371-V3.2.1/workspace/out.xml

As the exception message shows, the file doesn't exist, if you are checking 'append' option, the file must exist on your hard disk.

I tried to add a simple task to theat pre-job with a tFixedFlowInput and another tAdvancedFileOutputXML where the "append" option is not checked,

When you do a simple task for test, it is better to deactivate the second subjob.
About 'append the source xml file' feature, see topic:5975.

Best regards

          shong

brunogirin
2010-02-21 16:37:11

Following the details from this other post, I changed the structure to include a group element. However, I still get the following exception on this component when I run my job:

Code:

Exception in component tAdvancedFileOutputXML_1
java.lang.Exception: can not find the file:/home/bruno/TOS-All-r31371-V3.2.1/workspace/out.xml
    at filetransfer.filetransferjob_0_1.FileTransferJob.tFileList_1Process(FileTransferJob.java:2507)

Presumably, because I append to the file, it complains when the file doesn't exist. As I already have a tPrejob to clean up logs on startup, I tried to add a simple task to theat pre-job with a tFixedFlowInput and another tAdvancedFileOutputXML where the "append" option is not checked, in order to create the file's structure but that doesn't work either. Now, it only tells me that I have errors in both tAdvancedFileOutputXML but it doesn't give me any meaningful error message, nor are the errors listed in the "Problems" tab.

I attached a number of screen shots that show: what the overall job looks like and the XML tree configuration screen of both tAdvancedFileOutputXML.

brunogirin
2010-02-21 13:36:06

@shong: when I use tAdvancedFileOutputXML, I get errors that says: "Loop element is missing" or "Require set as loop or set as group at least". I tried to add a loop element called "row" under the rootTag and then mapping all fields but it doesn't seem to resolve the error. I've attached a screenshot to show what I mean.

shong
2010-02-21 02:40:11

@brunogirin
The 'append' option is avaliable on tAdvancedFileOutputXML component. We generally use tAdvancedFileOutputXML instead of tFileOutputXML to output a xml file.

Best regards

          shong

brunogirin
2010-02-20 21:01:23

@nkxxDV: that's what I thought but I can't find the "append" check box in the tFileOutputXML component. Is there another way to do that?

nkxxDV
2009-08-19 11:56:59

It's always the same problem when using an "iterate" link.

You have to create the file at the beginnint of the job :
tPrejob --onComponentOk--> tGenerateRow --Output--> tFileOutputXML

Then on the other component tFileOutputXML, check the "append" box.

This is the way I use, because it works exactly as if there was no "iterate" link in the process. Checking the "append" box on the existing component could be enough, but creating the file at the beginning of the job overwrites the file of the last execution, which is easier when developping.

richiej
2009-08-19 11:31:57

Hi,

I'm still fairly new to the use of Talend so apologies if this is a simple question but i'm still finding my way through all the components available in the studio.

I have a scenario where I need to

1) Retrieve ID's for users from a table in my database
2) Iterate through each ID and make a call to a webservice
3) Call the webservice method with the ID, and retrieve results
4) Output results for each ID into an XML file or some kind of output which can be manipulated further.

I have achieved the first 3 parts of this, the webservice retrieves the results for each ID, but at the moment all i can do with these is output them through the logrow component. I have attempted to output to an XML file, but this does not seem to let you append the xml file with the latest results, it just overwrites the contents, which as a result once the job is completed, leaves an xml file with just the last result of the iteration.

Does anyone have any suggestions, I have attached a screenshot of how the job currently runs.

Many thanks

Richard

Board footer

Powered by FluxBB