webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Flat file iterator issue

  • 1.  Flat file iterator issue

    Posted Mon July 14, 2008 11:18 PM

    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


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 2.  RE: Flat file iterator issue

    Posted Tue July 15, 2008 03:09 PM

    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


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 3.  RE: Flat file iterator issue

    Posted Tue July 15, 2008 03:19 PM

    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


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 4.  RE: Flat file iterator issue

    Posted Tue July 15, 2008 04:01 PM

    Hi .

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

    thanks


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 5.  RE: Flat file iterator issue

    Posted Tue July 15, 2008 04:59 PM

    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


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 6.  RE: Flat file iterator issue

    Posted Tue July 15, 2008 07:34 PM

    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


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 7.  RE: Flat file iterator issue

    Posted Tue July 15, 2008 09:44 PM

    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!


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 8.  RE: Flat file iterator issue

    Posted Tue July 15, 2008 10:03 PM

    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


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 9.  RE: Flat file iterator issue

    Posted Tue July 15, 2008 11:13 PM

    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!


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 10.  RE: Flat file iterator issue

    Posted Tue July 15, 2008 11:44 PM

    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


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 11.  RE: Flat file iterator issue

    Posted Wed July 16, 2008 03:29 AM

    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?


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 12.  RE: Flat file iterator issue

    Posted Wed July 16, 2008 03:37 PM

    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


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 13.  RE: Flat file iterator issue

    Posted Wed July 16, 2008 04:44 PM

    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.


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 14.  RE: Flat file iterator issue

    Posted Wed July 16, 2008 06:47 PM

    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


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 15.  RE: Flat file iterator issue

    Posted Wed July 16, 2008 08:54 PM

    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


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 16.  RE: Flat file iterator issue

    Posted Thu July 17, 2008 05:52 PM

    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!


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 17.  RE: Flat file iterator issue

    Posted Thu July 17, 2008 07:10 PM

    Please do keep us posted…

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

    HTH,
    RMG


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 18.  RE: Flat file iterator issue

    Posted Tue August 26, 2008 10:20 PM

    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


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods