Our partner will integrate with us by sending a file possibly containing different records each of which has a fixed length. The only know to know the type of record is to examine the 5th character ( of length 2 ) of each line, so I used the Segment Flat2Xml file with great success and I've been able to break up each line based on the type and insert each of the records to the database.
Now, what I need is basically error handling. It's possible that they will send us a record where the length is greater than agreed upon for a known record type or they can send us an unknown record type. Any suggestion on how I can solve it.
I was thinking that I would have to write my own Validate pipeline stage, detect those errors and insert them as part of the document. The current requirement on handling these errant records is to insert the full record fully to the database without breaking them up.
So here's my current pipeline ( without error handling ) :
Fresh Document -> Flat2Xml ( segmented ) -> XSLTTransform ( to insert SQL Statement ) -> SQLWriter. This thing is working.
my current thought:
Fresh Document -> Validate ( my own ) -> Flat2Xml( segmented ) -> Domify ( maybe this is unnecessary ) -> My Own Stage ( pull out the errors and insert them as children to the root element with their own specific tags to identify errors ) -> XSLT Transform ( insert SQL Statement ) -> SQLWriter.
Any thoughts ??
Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Our partner will integrate with us by sending a file possibly containing different records each of which has a fixed length. The only know to know the type of record is to examine the 5th character ( of length 2 ) of each line, so I used the Segment Flat2Xml file with great success and I've been able to break up each line based on the type and insert each of the records to the database.
Now, what I need is basically error handling. It's possible that they will send us a record where the length is greater than agreed upon for a known record type or they can send us an unknown record type. Any suggestion on how I can solve it.
I was thinking that I would have to write my own Validate pipeline stage, detect those errors and insert them as part of the document. The current requirement on handling these errant records is to insert the full record fully to the database without breaking them up.
So here's my current pipeline ( without error handling ) :
Fresh Document -> Flat2Xml ( segmented ) -> XSLTTransform ( to insert SQL Statement ) -> SQLWriter. This thing is working.
my current thought:
Fresh Document -> Validate ( my own ) -> Flat2Xml( segmented ) -> Domify ( maybe this is unnecessary ) -> My Own Stage ( pull out the errors and insert them as children to the root element with their own specific tags to identify errors ) -> XSLT Transform ( insert SQL Statement ) -> SQLWriter.
Any thoughts ??
Thanks.