Convert to array of records

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.



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.


CheckAndConvertToRecordList (2.0 k)

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


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


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.


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.