A method and device for generating mapping source code to establish mapping connections
between enterprise system nested array object fields and legacy system nested array
object fields is disclosed. For each desired mapping connection in a received list
of desired connections, a determination of an enterprise system field and legacy
system field to be mapped, as well as a connection nesting level, is made. The
identity of the system arrays containing the enterprise and legacy system fields
is also determined. A logical tree is created which includes a root node, one leaf
node for each desired connection, and, for each leaf node, N intermediate nodes
interconnecting the leaf node with the root node, where N is equivalent to the
determined nesting level of the connection associated with that leaf node, and
where each of the N intermediate nodes that is successively further from the root
node is associated with a successively more deeply nested target system array.
The tree is then traversed depth-first to generate the desired mapping source code.