Alright, I recovering from information overload. I read all the posting in this thread as well as the the thread Rob, pointed out above. So let me see if I got all this right.
There are three options here to deal with mapping and transformations of data for a complex structure, like recordList containing record and other record list.
Option 1) In Flow create a loop and specify the input and output arrays, then create your mappings under that loop. This options seems to be the best approach for a quick and simple mappings and is probably the fastest way to implement you logic; however, do I understand that in this flow implementation, that the flow will create references (shallow copy) of the structures, like record in the recordList, and perform the mappings from those references to the output record, which are also references, which has better performance, in that I do not have a physical copy of each structure as I loop through the list, but that the flow editor has, shall we say, some difficulties when it comes to editing the maps.
Option 2) As suggested by Rob, you create a loop specifing only the input array. Then create a temp structure,get the data via getRecordListItem and map to the temp structure, then append that temp structure to the output recordList, using the appendToRecordList service. The Cons here are having more work to do and having to manage the creation and clean up of the temporary structures that are created at each iteration. As well as, you are basically performing your own deep copy of the structures that you are mapping and therefore you are taking a performance hit in terms of memory and the number of step it take to perform the work, which could me non-trival if you have a large structure, and clean up for the temp structures. Good news is the flow editor has less difficulty in dealing with editing or the order of events used to create the overall flow and you are guarenteed to have the correct and physical copy of the data you want appened.
Option 3) Don’t do this in flow, do this as a Java service.
What are the pros and cons for writing a java service to preform this work?
Just wanted to make sure I understand the logic presented in this thread as well as the thread Rob mentioned above http://www.wmusers.com/wmusers/messages/117/366.shtml?
Any other thoughts, along the lines of evaluating different implemenations for this problem?