Flat file iterator issue

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

Hello

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

thanks
Anil

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.

Thanks for your time!
js

Hi .

i am little bit confused.Can you please send your flatfile testdata as an attachment.I will try it in my local

thanks

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

Hope that helps

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

Test the FFSchema with convertToValues…

HTH,
RMG

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.

Thanks for the help in resolving the first issue!

Hi Steven

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

Is this what your are looking for

thanks
Anil

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…

Let us know your testing…

HTH,
RMG

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…

This should give some break…

HTH,
RMG

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.

Definetely its a doctype or xpath hierarchy issue with the LOOP InArray syntax and may be iterator is doing some mess…

Can you upload some clear screen shots here…

HTH,
RMG

Hi

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)

let me know if i am anywhere close.Thanks
Anil

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!

Please do keep us posted…

BTW,Click on Go Advanced button and look for the Manage Attachments…to upload in general.

HTH,
RMG

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!

Thanks for all the help on this.
js