IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

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
  • 1.  Flat File Processing| Parent Child Relationship

    Posted Thu June 14, 2012 08:09 AM

    Hi All,

    We have a requirement to process a complex flat file.

    Flat file will have larger number of records in a parent child relationship depicted below:

    0001|abc|def… Parent Record.
    0001|abc|def…Parent Record
    0002|abc|def…Child Record
    0001|abc|def…Parent Record
    0002|abc|def…Child Record
    0003|abc|def…Child Record

    The record starts with 0001 is the parent record and all the below records will be its child record until it encounters another 0001 record.

    Our requirement is publish all the parent and child records together like:

    0001|abc|def…
    one doc will be publish containing only this record.

    0001|abc|def…Parent Record
    0002|abc|def…Child Record
    One doc will be published containing these two records.

    0001|abc|def…Parent Record
    0002|abc|def…Child Record
    0003|abc|def…Child Record
    One doc will be published containing these three records.

    Basically in total only 3 docs will be published .

    Please let us know how we can implement this in wm 6.5

    Thanks,
    Amit


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


  • 2.  RE: Flat File Processing| Parent Child Relationship

    Posted Fri June 15, 2012 11:25 AM

    Does the parent and child records have same number of fields? If so, a generic dict/schema will convert this data to an IS document, and using the flow logic, u can determine each group that can be published to broker.

    -Senthil


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


  • 3.  RE: Flat File Processing| Parent Child Relationship

    Posted Fri June 15, 2012 11:42 AM

    Hi Senthil,

    Thx for response. Ya all the aprent child has same number of fields.

    Also apart from creating the dic/schema, We have done below steps:

    1. Convert the flat file to string
    2. then convert the string to string list and then loop over the string list then using the flow logic we are segregating the records according to parent child relationships.

    Please provide your thoughts over this…

    Thanks,
    Amit


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


  • 4.  RE: Flat File Processing| Parent Child Relationship

    Posted Sat June 16, 2012 04:07 AM

    You are getting flatfile as your input right? Why do you parse it to IS doc, and then again convert it to string/string list?

    The records seems to have record identifier. convertToValues service displays records in IS doc format after parsing. In this doc, you can see a string called ‘record-id’ which will hold the value of identifier. You can loop over IS doc (ffvalues) directly and perform some logic i believe.

    -Senthil


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


  • 5.  RE: Flat File Processing| Parent Child Relationship

    Posted Tue June 19, 2012 09:55 AM

    0001|abc|def|Parent Record1
    0001|abc|def|Parent Record2
    0002|abc|def|Child Record2
    0001|abc|def|Parent Record3
    0002|abc|def|Child Record3
    0003|abc|def|Child Record31

    you can make record definition like this:

    0001(Parent Record Def)
    . – first Field
    . – second Field
    . —Third Field

    …0002(Clild Record Def)
    – first Field
    – second Field
    —Third Field

    …0003(Clild Record Def)
    – first Field
    – second Field
    —Third Field

    and in Flow service :

    –Get the file
    –Repeat loop
    – convertTovalue(set iterate true )
    —Do maping
    —Publish doc
    —Branch (check FFiterator=null then Exit from loop)

    it will work as you mention above:

    " First doc contain the details of this
    0001|abc|def…
    one doc will be publish containing only this record.

    second doc contain the details of this
    0001|abc|def…Parent Record
    0002|abc|def…Child Record
    One doc will be published containing these two records.

    and Third doc contain the details of this

    0001|abc|def…Parent Record
    0002|abc|def…Child Record
    0003|abc|def…Child Record
    One doc will be published containing these three records.

    Basically in total only 3 docs will be published ."

    Regards
    Mukesh


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