i want to transform a csv-file to an XML-file. In the Transformation i have also a small Validation of data, for example length of a string must be < 50. So i have a Textfile Input Step > Modified JavaScript Step with two hops to Abort Step (for the error handling hop) and XML Output Step. My goal is to only create the XML-file if no error occurs. At the moment it create a XML with 2 "rows" and Abort because in row 3 in csv is a very long string. I think it is a very simple scenario but i have no approach how to solve it. Please can someone give me a tip. Thanks a lot. Marko
Asked
Active
Viewed 300 times
2
-
Let me try to better understand, you want filter Strings that have 50 characters or longer, and alert the user of longer Strings, but still create the XML file with the valid Strings ? Or create the XML ONLY if there are valid Strings ? – Cristian Curti Nov 08 '18 at 19:44
1 Answers
0
EDITED:
It seems your flow is indeed halting strings longer than 50 characters if it is aborting midway, but since Pentaho works in parallelism, if the first row is valid and reaches the output step, the output will start recording, what you want is to block this step until all rows have been processed by the prior step.
Simply add a "Blocking Step"(do not mistake the Block this step until steps finish, you want Blocking Step)before your output step. Remenber to check 'Pass all rows?' option ins this step, this will effectively "Hold" all the rows in the transformation right before the output.

Cristian Curti
- 1,004
- 1
- 7
- 13
-
Hello Cristian, no i dont want change the data. In case of invalid data the user gets an error to correct the data that are invalid in the source of data. – Marko Unverzagt Nov 08 '18 at 19:23
-
Hi Marko, Cristian's solution works fine according to your requirement. Not sure what are you telling here "I dont want change the data". Could you please elaborate? – Kullayappa M Nov 10 '18 at 15:12
-
I had another probable answer that i erased prior to this one. Thought it was better to delete it rather than leave it there. – Cristian Curti Nov 10 '18 at 17:04
-
@Cristian, thats exactly what i want.Sorry for the bad english i am german :) Change data means not to edit the data. Thank you very much. – Marko Unverzagt Nov 13 '18 at 08:04