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.  Convert to array of records

    Posted Wed December 03, 2003 07:58 PM

    Hey I have a scenario where my input data structure is a array of record (record list) which is mapped to a field in the output. However my runtime data has only one element so the data in the pipeline is not shown as an array.

    My question is : How can I convert my record to array of records at runtime so that mapping to a field with an index works.

    Any advise would be helpful.

    -Ravi


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


  • 2.  RE: Convert to array of records

    Posted Wed December 03, 2003 08:37 PM

    Ravi,

    If I understand you correctly. You have a recordList structure defined but because there is only one occurrence of the data it gets interpreted as a record during run time.
    If thats the case thn the attached java service should help.
    I don’t remember where I got it.

    HTH

    CheckAndConvertToRecordList
    CheckAndConvertToRecordList.zip (2.0 k)


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


  • 3.  RE: Convert to array of records

    Posted Wed December 03, 2003 08:40 PM

    Really appreciate the quick response Chris. And you got my question right.

    -Ravi.


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


  • 4.  RE: Convert to array of records

    Posted Wed December 03, 2003 08:45 PM

    Chris you forgot to attach the java file. I have the ns folder in it not the code.

    -Ravi.


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


  • 5.  RE: Convert to array of records

    Posted Wed December 03, 2003 09:26 PM

    Thanks Chris, I was also working on the same lines.

    However I have another question relating to this and would really appreciate if you/ anyone else could clear that. If I were to map a record list from soucrce to record list which is input to the java service. Do I have to mention the index of the source and destination?

    If I don’t do then I am getting a null from the source. If I do then I would always get a fixed record.

    Let me know if you have any ideas.

    Thanks
    -Ravi.


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


  • 6.  RE: Convert to array of records

    Posted Fri December 05, 2003 03:00 PM

    Hi ravi,

    I am not sure if you have already found solutions to your problem.

    We used to get similar issue, when we used to convert an XML to a recordlist. If XML provided only one instance of data, it used to become a record in place of a recordlist at the time of using pub.web:documentToRecord. (I use webMethods 4.6). We solved it by using recordName parameter (it was always there, we missed it and someone on wmuser helped to remind)

    If you ware copying data from one recordlist to another recordlist, and you wish to copy every segment, then you would not need to give any index. The cause of you getting null should be something else.


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