Convert Availability List to XML Quote Document

Complete the following steps to design a node to transform the availability 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

  1. Expand the priceAvailTransformations control instance in the Data Palette, then click the following method:
  2. AvailQuoteDocument convertAvailListToXML(com.bea.xml.XmlObjectList _XmlObjectListDoc)

    image

  3. Drag the method from the Data Palette and drop it on your RequestQuote business process in the Design View, placing it immediately after the Convert PriceList to PriceQuote XML node.
  4. image

  5. Rename the node from convertAvailListToXML to Convert AvailList to AvailQuote XML.
  6. Double-click the Convert AvailList to AvailQuote XML node to open its node builder.
  7. Verify that the priceAvailTransformations control and the following method are selected on the General Settings tab:
  8. AvailQuoteDocument convertAvailListToXML(com.bea.xml.XmlObjectList _XmlObjectListDoc) 
    
  9. Click Send Data to open the second tab in the node builder.
  10. The Control Expects field is populated with XmlObjectList, which is the data type expected by the convertAvailListToXML() method on the priceAvailTransformations control.

  11. On the Send Data tab, under Select variables to assign, click the arrow in the variable assignment field, and select availList (XmlObjectList).
  12. Click Receive Data to open the third tab in the node builder.
  13. The Control Returns field is populated with AvailQuoteDocument, which is the data type returned by the convertAvailListToXML() method on the priceAvailTransformations control.

  14. Click the arrow associated with the Select variables to assign field, and click Create new variable .... The Create Variable dialog box is displayed.
  15. In the Variable Name field, enter availQuote.
  16. image

  17. In the Select Variable Type field, click the + beside AvailQuote.xsd in the XML Types list, then select availQuote from the list. The Variable Type field is populated with org.example.avail.AvailQuoteDocument.
  18. Click OK to close the Create Variable dialog box.
  19. To close the node builder, click the X in the top right-hand corner.
  20. This step completes the design of the Convert AvailList to AvailQuote XML node. At run time, the availability quote data in XML format are assigned to the availQuote variable.

Note About the Transformation on This Node

The convertAvailListToXML() method on the priceAvailTransformations control does the work of creating the availability quote XML data. The input to convertAvailListToXML() is the availability data returned by the availProcessor control after the iterations in the For Each node complete.

You can double-click PriceAvailTransformations.dtf in the Application pane to display the Transformation control in Design View. Right click on convertAvailListToXML method, and select Go to XQuery Document to open the Transformation tool. The following figure shows the map for the convertAvailListToXML() method:

image

The preceding figure shows the transformation of the data in a variable of type XmlObjectList, which contains a repeating set of untyped XML data, to the repeating element in an XML-typed variable. Note that to achieve this transformation, the repeating element in the target schema must be the single child of a root element. In this case, availRequest is the repeating element, and it is the single child of the availQuote element. Click the Source View tab in the Transformation tool to see the corresponding XQuery.

Previous Document Next Document