Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] tXMLMap - catch errors/exceptions

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?
Labels (3)
24 Replies
Anonymous
Not applicable
Author

A new feature has been reported in bugtracker, see 
https://jira.talendforge.org/browse/TDI-18968
Anonymous
Not applicable
Author

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?
Anonymous
Not applicable
Author

Yes, that is the way that I would attempt this to make use of the tMap error logging functionality.
Anonymous
Not applicable
Author

Okay thanks for the suggestion, will try this out and update this topic accordingly.
Anonymous
Not applicable
Author

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?
Anonymous
Not applicable
Author

This is very odd. Can you take a screenshot of your job, your tMap configuration and the following tXMLMap config?
Anonymous
Not applicable
Author

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:
0683p000009MBNG.png
My tMap component has the parsing and formatting conditions, with the die on error unticked:
0683p000009MCWo.png
And my tXMLMap is a straight auto-map into the XML structure:
0683p000009MCRp.png
Is there some hidden or inconspicuous setting that I might have missed or is this some Talend bug?
Anonymous
Not applicable
Author

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.
Anonymous
Not applicable
Author

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.
Anonymous
Not applicable
Author

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.
0683p000009MCWt.png