Complete the following steps to design a node to transform the price list (created as a result of iteration through the For Each loop) to a variable whose data type is typed-XML. To do so, you use methods on the priceAvailTransformations control.
To Design the Interaction With the Transformation Control
PriceQuoteDocument convertPriceListToXML
(QuoteRequestDocument _quoteRequestDoc, XmlObjectList _XmlObjectListDoc)
PriceQuoteDocument convertPriceListToXML
(org.example.request.QuoteRequestDocument _quoteRequestDoc, com.bae.xml.XmlObjectList _XmlObjectListDoc)
The Control Expects field is populated with the data type expected by the convertPriceListToXML() method on the priceAvailTransformations control:
Note: The convertPriceListToXML()method on the priceAvailTransformations control is designed to achieve two goals: First, to transform the XmlObjectList price data to typed XML, and then to combine the customer name, the shipping address, and the price quote data (the price list) in a single variable. The convertPriceListToXML() method receives the price list in a parameter of type XmlObjectList, and the customer name and shipping address in a parameter of type QuoteRequestDocument. To learn more about the priceAvailTransformations control, see Note About the Transformation on This Node.
The Control Returns field is populated with PriceQuoteDocument, which is the data type returned by the convertPriceListToXML() method on the priceAvailTransformations control.
This step completes the design of the Convert PriceList to PriceQuote XML node. At run time, the price quote data (in typed-XML format), and the customer name and shipping address are assigned to the priceQuote variable.
Note About the Transformation on This Node
The convertPriceListToXML() method on the priceAvailTransformations control does the work of creating the price quote XML data in the preceding step.
In brief, the input to the Transformation method includes the original data sent by the client (in the requestXML variable), and the price data returned by the priceProcessor control (in the priceList variable) after the iterations in the For Each node complete.
The convertPriceListToXML() method extracts the customer name and shipping address from the requestXML variable, and a list of widget IDs and prices from the priceList variable, and maps the data to the new variable (priceQuote).
It is left as an exercise to the reader to view this and other transformation methods on the priceAvailTransformations control. For example, you can double-click PriceAvailTransformations.dtf in the Application pane to display the Transformation control in the Design View. Right-click on the convertPriceListToXML method, and select Goto XQuery Document to open the Transformation tool. Use the Design View and Source View tabs in the transformation tool to see the data map that represents the transformation and the corresponding XQuery. Use the Test View tab to test the XQuery. For example the following figure shows the map for the convertPriceListToXML() method:
Tutorial: Building Your First Data Transformation
![]() |
![]() |