I’m trying to use a flat file iterator. I’m so close, but can’t get past this issue: The file structure is like this: Header D1 d2 d2 D1 d2 d2 d2 d2 D1 d2 Trailer I’m expecting the iterator to read in one record at a time, and it’s doing just fine to start: Header D1 D2 d2 ++++but then things go wrong - the last d2 record comes in with the next D1 record as a sub-field –D1 d2 +++++ Then they are fine until d2 d2 d2 +++++I get to the last d2 record –D1 d2 Trailer ++++ The last d2 record before the Trailer record does not have the issue
The schema is set up with the Header & Trailer being Mandatory (1 only) & Ordered The D1 & d2 records are not ordered & are unlimited Any help would be greatly appreciated. js
can you please explain your ffschema in more detail.Are you using newline delim for both record and field .And what is first field position you are starting with . Please give more details of your schema
Hi! I am using newline delim for only the record - the fields are positional. The first field starting position is 0. All lines in the test file end with hex 0a (which is newline).
The reason that I find this so confusing is that the D1 record is being fully mapped as a sub-document of the d2 record, but in the schema, the D1 and d2 records are at the same level.
I cannot figure out how to send you the attachment, but this is a fair representation of the file: HEAD ICN00001234TESTCOMPANY
BILL BILL1-1234.56
LINE BILL-LINE1CODE123
LINE BILL-LINE2CODE456
BILL BILL2-0001.00
LINE BILL2-LINE1CODE111
LINE BILL2-LINE2CODE222
LINE BILL2-LINE3CODE222
BILL BILL3-9999.99
LINE BILL3-LINE1CODE789
TRLR 3123478
The HEAD record contains header information The BILL record contains bill information The LINE record contains bill line detail information The TRLR record contains trailer/total information
Try to define your FFSchema in the exact same hierarchy (arrow marks) shown below:
Record seperator-newline
HEAD (Record Definition)–set maxRepeat=single
—>HEAD Field Definitions
—>BILL (Record Definition) --set maxRepeat=unlimited
--------> BILL Field Definitions
-------->LINE (Record Definition) - set maxRepeat=unlimited
------------>LINE Field Definitions
—>TRLR 3123478 – set maxRepeat=single
------>TRLR Field Definitions
That did the trick for the issue - it got me one step farther! I originally had this overall structure, but I must have had the BILL rec setup to have a max of 1 because all of the LINE recs were showing up under the first BILL rec.
Now as I’m trying t loop over the LINE recs, I’m receiving a new error:
FlowException:Unable to find required service parameter CONTENT_DOCTYPE_MAP
In the flow pipeline, the LINE rec is showing up as a doc list, but in the results it’s showing up as a doc.
Sorry for getting back late. But for your convinience i implemented the flowservice based on the schema that RMG suggested. And its working for me .I was able to loop on the line records. Here is what i did
–>step1:map ( hard code your ff data)
–>step2: convert to values ,inputs: your ffdata,ffschema and outputs: ffschemaDT
–>step3:loop on schemaDt/Head/bill
----->step4:subloop on schemadt/head/bill/line
And i can also see LINE records as list .for example for you first set of Line records i see
line(list)
–line[0]
–values
—line[1]
–values
That is getting very close. I’m actually seeing what you see in the results pane, but my problem was actually since the flow was showing a doc list, but the results actually had only a doc, the mapping of the data was not functioning properly. I did find a way around the issue by actually manipulating the flow.xml. That certainly is not the optimal solution, but since the Loop over function was not working (it should have turned the LINE record to a doc when it was being LOOPED over), I could not see any other way around this.
I actually have everything working exactly the way I need it to do so now. I wonder if the issue that I’ve got with the doc list not turning into a doc within a loop is actually a bug in 7.1 - this is my first project in 7.1, so it just might be. If anyone else has seen the issue, please let me know.
Thanks to all who chimed in to help - it’s greatly appreciated!
Are you mapping convertToValues output ffValues to the FFDocumentType (DocumentReference for the schemaDT above) and this should show the LINE also as docList in the results/pipeline…
Yes, I’m doing that. It’s showing properly as a doc list in the results when the convertToValues is completed. The problem is that when I enter the Loop over the LINE document, in the flow it’s showing up as a doc list rather than as a single doc. That means that any mapping that I try to do causes the error. Any map lines that are drawn turn blue meaning that it’s a list. I tried setting the index to 0, but the error still came up.
I suppose I could try moving the full doc list (BILL/LINE) to another doc list & looping over that. Any other ideas?
You have to use 2 loop steps inorder to get to LINE hierarchy level,Is this what you have in place??
Loop (InArray - docname/HEAD/BILL)
-------> Map step BILL fields
---->Loop(InArray - docname/HEAD/BILL/LINE)
------->Map step LINE fields (check here the LINE node should see as Doc instead of doclist)
If the above true then just move the map step move outside loop and then move inside and see the pipelinein and then link the LINE fields to the pipelineout…
I actually only have one loop needed because of the flat file iterator. The iterator is returning only 1 BILL record with multiple LINE records. The BILL record fields are mapping just fine as they are showing up as single docs in the flow. The LINE is showing up as a doc list, and I’m expecting that within the loop that it will become a single doc, but it’s not.
I’ve tried mapping the Line list to a completely new list, but that’s not working either. It’s so frustrating - I can see exactly what’s needed in the result pane, but the flow is showing something different.
i Tried using the iterator and i see the similar behaviour in wM6.1 also.I dont know why (may be we need to do some research on this) .But why dont you try this
after convert to values,Loop on the bill records .Then you will be able to get one BILL then after that use a repeat step with repeat count=1 And map the values in the LINE items and Exit the flow.By this you will be able to get the 1st LINE record values from the 1st BILL record ( Is this what you are looking for)
I’m sorry, but I don’t know how to upload screenshots to this site. I’ve just put in an SR with webMethods. Once I find out what the issue is, I’ll let you know. Thanks for all of your help!
Hi there - I haven’t forgotten about my promise to let you know what I learned from webMethods. I finally received a reply yesterday that they were able to recreate the issue and have reported it to the R&D group.
So it looks like I’ve managed to find a bug with my very first 7.1.1 flow. Sure hope that trend doesn’t continue!