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.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
  • 1.  Parsing a complex flat file

    Posted 05/25/16 09:06 AM

    Hello,

    I have a requirement to parse a content seen below to a IS document type, it appears to a complex flat file with lot of delimiters. Need assistance on what delimiters do we make use of in flat file schema to parse this content.


    [{“day”:“2016/06/13”,“machineShifts”:{“001_10”:[{“id”:4063370,“factory_fk”:1,“shift”:“Morning”,“person”:“x”,“week”:201624,“day”:“2016/06/13”,“machinename”:“001_10”,“color”:null,“noHours”:8},{“id”:4063371,“factory_fk”:1,“shift”:“Evening”,“person”:“x”,“week”:201624,“day”:“2016/06/13”,“machinename”:“001_10”,“color”:null,“noHours”:8},{“id”:4063372,“factory_fk”:1,“shift”:“Night”,“person”:“x”,“week”:201624,“day”:“2016/06/13”,“machinename”:“001_10”,“color”:null,“noHours”:8}]“201_10”:[{“id”:4063412,“factory_fk”:1,“shift”:“Morning”,“person”:“x”,“week”:201624,“day”:“2016/06/13”,“machinename”:“201_10”,“color”:null,“noHours”:8},{“id”:4063413,“factory_fk”:1,“shift”:“Evening”,“person”:“x”,“week”:201624,“day”:“2016/06/13”,“machinename”:“201_10”,“color”:null,“noHours”:8},{“id”:4063414,“factory_fk”:1,“shift”:“Night”,“person”:“”,“week”:201624,“day”:“2016/06/13”,“machinename”:“201_10”,“color”:“rgba(0, 0, 0, 0)”,“noHours”:8}]}}]

    Thank you.


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


  • 2.  RE: Parsing a complex flat file

    Posted 05/25/16 05:11 PM

    It looks like a JSON object. you can try to parse it using a Json parser first.


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


  • 3.  RE: Parsing a complex flat file

    Posted 05/26/16 08:05 AM

    If is a valid json string then you can use the service “pub.json:jsonStringToDocument”. Make sure you have wM 9.0 and above.


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


  • 4.  RE: Parsing a complex flat file

    Posted 05/26/16 08:10 AM

    Thank you Mahesh & Tong Wang for the reply.

    Yes, able to parse successfully using pub.json:jsonStringToDocument in 9x but unfortunately my requirement is in 7x.

    Trying to import the source code / class file of this service from 9x->7.3 and try. Any suggestions?


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


  • 5.  RE: Parsing a complex flat file

    Posted 05/26/16 08:15 AM

    No comments on your approach :slight_smile:

    But you can try the code available at webMethods: Handling JSON in the ESB


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