nested arrays in Java read

Hi guys
Need your hint how to read and create and put the resulted object in pipeline
It is a simple loop in Java , but I can not create it in flow:

MyInputDataObject
reults[reults[0], …results[20]]
Each results Object contains few values. Example for results[0]: parameter1, parameter2,…parameter20 (name, age, year,… )

MyOutputDataObject

for each results{
   create new output
      output[i].a_parameter=parameter1
	  output[i].b_parameter=parameter2
	  ...
	  for each results{
	      create new child[j]
	      output[i].childs[j].myParameterA=  parameter10
		  output[i].childs[j].myParameterB=  parameter11
		  ...
		 }
 }

brg
Peter

Hi Peter,

not sure if this is what you need:


init empty output doc list
Loop over your input
1. init temp output doc
2. map the direct parameters (a_parameter and b_parameter in your sample)
3. init empty child doc list
4. map the child parameters (myParameterA and myParameterB in your sample) to temp child doc
5. add the temp child doc to child doc list
6. drop temp child doc
7. repeat steps 4. to 6. for all remaining matching child docs
8. add child doc list to temp output doc
9. add temp output doc to output doc list
10. drop temp output doc
End loop
use output doc list for further mappings

Regards,
Holger

Hi Holger
I do not need logical language or pseudo algorithm, I need it in IData and IDataCursor language :slight_smile:
Can you put some code and show how to get Array from a Idata and loop over this Array object
Example
IDataCursor pipelineCursor= pipeline.getCursor();
IData iputData= IDataUtil.getIData( pipelineCursor, "MyInputDataObject" );

for ( int i= 0; i < iputData.length; i++ ) {
//what and how ?
for ( int j= 0; j < whatEver.length; j++ ) {
//what and how ?
}

}

??

Hi Peter,

you talked about flow service, not java service.

Please take a look at the IntegrationServer JavaAPI Reference.
Most likely the Class IDataUtil has some meaningful methods.

Regards,
Holger