Hi guys,
I have a small Talend job that reads CSVs and makes an XML from its rows, then moves the CSVs in an archive folder afterwards.
Im having a problem trying to catch CSVs with errors, the job stops and doesnt continue on the other CSVs afterwards.
How can I catch the errors in the XML mapping and be able to move that certain CSV, then continue with the other CSVs in processing them?
I see, so my job layout should now be . . . Before: tFileList --(iterate)-- iFileInputDelimited --(row)-- tXMLMap After: tFileList --(iterate)-- iFileInputDelimited --(row)-- tMap --(row)-- tXMLMap Where tMap now has the formatting codes and tXMLMap is merely assigning the fields to their respective XML elements, is that correct?
Hello,
I am now able to continue after encountering a row error. Thanks rhall_2.0 and shong.
Unfortunately if consecutive errors are shown as 1 when I try to print something in the ErrorReject row.
Also, it ignores the first okay row after encountering an error row/group of error rows.
For example, this is my csv file:
- headers
- ok row
- ok row
- ok row
- error row
- error row
- ok row
- ok row
- ok row
- error row
- error row
- error row
- ok row
- ok row
It prints the following:
- ok
- ok
- ok
- error (should be 2 times)
- ok
- ok (should be 3 times together with previous print)
- error (should be 3 times)
- ok (should be 2 times)
How can I make it print "error" for each instance of the error row, and not as a group of consecutive error rows?
I find it very weird also, I was expecting it to correctly print according to the ok/error row.
Anyways here is my job layout:
My
tMap component has the parsing and formatting conditions, with the die on error unticked:
And my
tXMLMap is a straight auto-map into the XML structure:
Is there some hidden or inconspicuous setting that I might have missed or is this some Talend bug?
Where is the code written in the tJavaFlex component logging the errors?
In your tXMLMap output table settings (click the spanner symbol), do you have "All in one" selected? This allows one XML file to be written containing several loops as opposed to a separate XML for every row.
Maybe try connecting you tMap outputs to tLogRow components (instead of the tJavaFlex and tXMLMap) and and see what comes out from there. You should be seeing something for every row.
Where is the code written in the tJavaFlex component logging the errors? It is in the tJavaFlex_7, the one connected with ErrorReject row from the tMap
In your tXMLMap output table settings (click the spanner symbol), do you have "All in one" selected? This allows one XML file to be written containing several loops as opposed to a separate XML for every row. I have set "All in one" into false because I have to generate 1 XML per row read from the CSV.
Maybe try connecting you tMap outputs to tLogRow components (instead of the tJavaFlex and tXMLMap) and and see what comes out from there. You should be seeing something for every row. Only 1 instance of tLogRow output gets printed instead of the 2 or 3 consecutive for the error rows. Same goes for the ok rows.
ADDITIONAL:
My job also shows that it processed 8 rows, with 6 ok and 2 error when instead it should be 13 rows with 8 ok and 5 errors. No limit has been set.