How to create a new RecordList

Hi,
I am defining a list as follow.
IData ORDER_CFGS_VALUE = new IData[1];

I want to add let us say 10 more values in it, how I can do that?

Thanks,
Pras

Hi, Pras.

My first thought is that you should break the Java habit and let webMethods do the nasty work for you.

Tell us more about what you are trying to accomplish and maybe we can find a cleaner solution for you.

Please provide as much information as you can to help get the proper answer.

Thanks.

One can create an empty RecordList by creating a defintion of a RecordList in a Flow Map and use Developer to set a value to it (blue arrow) w/o any data in it.

I do this before a loop that calls appendToRecordList to fill it.

If the loop is performance sensitive and can be called with more than 5-15 entries, then I use a service that creates a real Java List and use services to add to it and then convert it to an Array after the looping is done.

See WmSamples samples.complexMapping.largeDoc.messageBuilder for examples of these little services.

Pras,
Once an array has been created, you can’t dynamically increase the physical size of an array. You can do so with objects that implement the java.util.Collection interface, but these have a little more abstraction involved than working directly with arrays.

   You should also only use capitals for a constant reference ([url]http://java.sun.com/docs/codeconv/html/CodeConventions.doc.html)[/url]. 

   If you are not sure what these terms mean, you could perhaps consider working through [url="http://developer.java.sun.com/developer/onlineTraining/"]http://developer.java.sun.com/developer/onlineTraining/[/url] or [url="http://java.sun.com/docs/books/tutorial/"]http://java.sun.com/docs/books/tutorial/[/url] . 

  You'd need to follow another technique to achieve what you want in Java. As Dan Green said, it's probably better to do it in FLOW. 

Nick_F