“Loops can be a killer in wm”
Thanks for this. I feel like an eejit for having so much trouble with this.
Okay, I’ve learned one difference between Documents and Document References that’s key: You can only create a reference to a Document that’s defined in your packages. So I can have a reference to the T850DT root document type, and I can have Document and Document List inputs that are PO1 and CTP children of the T850DT/ST root, but I CANNOT have references to PO1 or CTP because neither of those are defined in my packages. I lose all the underlying child info. THAT’S a big difference. (Sorry for being so slow.)
Here’s what I see happening in my debugger when I step through. I have five services involved, and I can see exactly where I go wrong. (I just don’t know what to do about it yet.)
service input = T850DT reference
service output = TrustedLinkPORequest
This is the top level service that has a MAP step for the header, a service named MapAll850LineItemDetails, and another MAP step for the summary. If I click on the “MapAll850LineItemDetails” service in this flow, I see that the pipeline input maps its PO1 document list to the service input; ditto for the output “11” document list. When I step through the debugger, I can see all the header info in the output TrustedLinkPORequest and the complete contents of the T850DT input doc in the Results tab.
service input = PO1 Document List
service output = 11 Document List (Yes, that’s “11” as in “eleven”. Crazy schema.)
This service has a LOOP at the top that has /PO1 as the input array and /11 as the output array. The body of the loop contains a single INVOKE step: Map850LineItemDetail(Note: no mention of parent in arrays.) When I look at the pipeline I see that I’m mapping the PO1 list Document (NOT a reference) from the T850DT into the service input PO1 list; same with the output. When I step into this INVOKE in the debugger I can see a PO1 Document List with 3 child documents underneath, plus the complete T850DT and partial TrustedLinkPORequest.
service input = PO1 Document
service output = 11 Document
This service contains a MAP step for the line item info, an INVOKE step called MapAll850PricingInfo, and another MAP for tax exempt info. When I look at the pipeline I see that I’m mapping the CTP list child from the PO1 into the service input PO1 list; same with the output. When I step in using the debugger I see the first PO1 Document. It has a Document List of CTP children of length one.
service input = CTP Document List (NOT a Document Reference List)
service output = 12 Document List (“twelve”; NOT a Document Reference List)
This service has a LOOP at the top that has /CTP as the input array and /12 as the output array. (Note: no mention of the PO1 or 11 parents.) When I step into this service and look at the Results tag, I see the CTP Document List with a single CTP Document child underneath, along with some other documents. When I enter the LOOP, I see the first CTP Document on the Results tab.
service input = CTP Document
service output = 12 Document (“twelve” Document)
This service has a single MAP step that copies values from the CTP Document into the 12 Document. On the Results tab I can see the first CTP document and its values, so I believe that information is getting down to the service. When I exit this service, I can see the 12 Document populated with the proper values. This appears to be the point at which I lose the 12 data It