Thank you HAL for your response!
Yes, I am past handling/parsing the flat file content. Also, I looked at the Ezine article on Writing Custom Content Handlers (this the only one I could find by Igor Androsov. Is this the one you were talking about?
I am using the EDI Adaptor to in parsing the legacy flat file. I have done that sucessfully. So, since I have parsed the flat file, using the convertToValues service, it outputs a record containing the parsed data. I am now trying to take that data and map it into a UDM/Cononical record (this record is actually based on the OAGIS BOD show_po). Since in the legacy file there are Purchase Order rows, I am trying to create a specific record containing the purchase order header and line item data. So, I am trying to put structure around the legacy flat file.
Below is a copy and paste of the flow service I am currently testing this out with.
2 INVOKE stringToDocument
3 INVOKE documentToRecord
4 INVOKE convertToValues
6 LOOP OVER ‘/MapParsedFields/recordWithNoID’
7 LOOP OVER ‘/TempPONumber’
7.1 TBIMainLoop: LOOP OVER ‘/MapParsedFields/recordWithNoID’
7.11 BRANCH on
7.111 (((%/MapParsedFields/recordWithNoID/POLineItemNum% = “01”) && (%/MapParsedFields/recordWithNoID/PONumber% = %/TempPONumber/CarlPONumber%))) || (((%/MapParsedFields/recordWithNoID/POLineItemNum% != “01”) && (%/MapParsedFields/recordWithNoID/PONumber% = %/TempPONumber/CarlPONumber%))): SEQUENCE
7.1112 EXIT ‘TBIMainLoop’
8 INVOKE savePipelineToFile
I think I am doing something wrong with the double loops, or maybe I could be using the BRANCH statement being using incorrectly? In my first posting, this is ideally what I am trying to do with this. Is there a way to use the BRANCH statement in a better way? Is there anything I can do better that jumps out at you? Is there an example that shows how to do this type of a complex loop, and branch anywhere, and how to create temporary fields within the loop, and then to output each PO, while populating each UDM/Canonical. There may be 10 PO’s and each PO has various line items. Once one PO and the line items for that PO have been mapped, I want to then send that PO somewhere and then move onto the next PO in the record.
I know I could write a Java Service which would do this, but ideally I want to do this within Flow. Are there any limitations to doing this within Flow? Do you think this would have to be done in a Java Service? Logically, this would be easy, but very time consuming.
Thanks again HAL!!!