Does anybody help me on mapping problem of lineitems to the UDM documentlist.
There are LineItem under OrderHeader LineItems are DocumentList has to map to the UDM documentlist of purcahseOrderLine , so i have taken loop to map documentlist lineitems to the UDM Documentlist, i have given input array as /PurchaseOrder/OrderLine and ouputarray as /UDM2.PurchaseOrder.ProcessPurchaseOrder.doc:ProcessPurchaseOrder/ProcessPurchaseOrder/DataArea/PurchaseOrder/PurchaseOrderLine documentlist and in the loop i have taken map flowstep to map to the UDM document in loop flow step.After Loop Step Both /PurchaseOrder/OrderLine,UDM2.PurchaseOrder.ProcessPurchaseOrder.doc:ProcessPurchaseOrder/ProcessPurchaseOrder/DataArea/PurchaseOrder/PurchaseOrder has become document from documentlist in the map flow step.
I have done the mapping of OrderLine items to the UDM document items in the mapping flowstep.
Problem is in the first loop all the /PurchaseOrder/OrderLine items are mapping to the UDM2.PurchaseOrder.ProcessPurchaseOrder.doc:ProcessPurchaseOrder/ProcessPurchaseOrder/DataArea/PurchaseOrder/PurchaseOrderLine correctly but in next loop /PurchaseOrder/OrderLine items values are overridding the mapping values of the first loop mapping.
Before Loop
/PurchaseOrder/OrderLine is a document list and /UDM2.PurchaseOrder.ProcessPurchaseOrder.doc:ProcessPurchaseOrder/ProcessPurchaseOrder/DataArea/PurchaseOrder/PurchaseOrderLine is document list Before Loop
AfterLoop
/PurchaseOrder/OrderLine is a document and /UDM2.PurchaseOrder.ProcessPurchaseOrder.doc:ProcessPurchaseOrder/ProcessPurchaseOrder/DataArea/PurchaseOrder/PurchaseOrderLine is document
If /PurchaseOrder/OrderLine having Two Array values Then,
After FirstLoop Mapping
/PurchaseOrder/OrderLine[0] are mapping to the /UDM2.PurchaseOrder.ProcessPurchaseOrder.doc:ProcessPurchaseOrder/ProcessPurchaseOrder/DataArea/PurchaseOrder/PurchaseOrderLine[0].
After Second Loop
/PurchaseOrder/OrderLine[1] are mapping to the /UDM2.PurchaseOrder.ProcessPurchaseOrder.doc:ProcessPurchaseOrder/ProcessPurchaseOrder/DataArea/PurchaseOrder/PurchaseOrderLine[0].
How to Rectify Mapping problem,If anybody help me on this it is going to be a good favour to me…
If u are giving the documentLists in the input array and output array they have to be in the similar structure otherwise it would not give correct results
if remove the names of ducuments from the input/output arrays how it is go to the loop , it is not going inside the loop without giving input array value atleast,if not giving error, After i gave atleast input array dcoment as a /PurchaseOrder/OrderLine than loop is executing and bhehaving same
I believe what Jeevan is saying is to remove the OutputArray… if your source and target documentLists are different, then loop over the source and map the individual elements of the source document (the documentList when looped over will result into a document in each iteration of the loop) to the target document. As the last step of the loop, use appendToDocumentList to create a documentList of your target document. Here’s what I mean:
|–Loop [PurchaseOrder/OrderLine]
|----|----- map [PurchaseOrder/OrderLine/element 1 to NewDocument/element 1]
|----|----- map [PurchaseOrder/OrderLine/element 1 to NewDocument/element 2]
|----|----- map [PurchaseOrder/OrderLine/element n to NewDocument/element n]
|----|----- pub.list:appendToDocumentList [map NewDocument to fromItem and collect toList to toList documentList]
|–map [toList to NewDocumentList]
Where NewDocument/NewDocumentList is your target document/documentList. I’d reckon you read the Developer guide to understand how the loop works and the BISReference guide to understand how appendToDocumentList works.
This is the classic looping problem that most people new to IS encounter. Please do a search on this forum for looping. There are lots of threads that cover how to properly loop and create new records for the target list in each iteration of the loop. Jeevan’s comment about both lists being similar in structure is not accurate. The structure of elements in each list don’t have to match in any way.
Please follow Rohit’s suggestion the process is little tricky though,doing it will solve the problem of building POLineItemslist to UDM doclist as expected.please make sure you drop the fromItem,NewDocument in the pipelineout while appending itself.
Here lot of threads covered how to use of appendToDocumentlist in detail.
Be aware that the performance of appendToDocumentList deteriorates badly when the list is large (depends on a number of factors, but performance degrades after a few hundred items are added to the list).