Combine Price and Availability Quotes

Complete the following tasks:

To Create an Instance of the TutorialJoin Control in Your Project

The TutorialJoin.dtf control is provided in your tutorial application. It is available in the requestquote folder in your Tutorial_Process_ApplicationWeb project folder. To learn how to build the TutorialJoin.dtf control, see Tutorial: Building Your First Data Tansformation.

Complete the following steps to add an instance of this control to your business process.

  1. If the Data Palette is not visible in WebLogic Workshop, choose View —> Windows —> Data Palette from the menu bar.
  2. On the Applications pane, click the TutorialJoin.dtf file
  3. image

  4. Drag the TutorialJoin.dtf file from the Applications pane onto the Data Palette. The instance of your control (tutorialJoin) is created and displayed in the Data Palette as shown in the following figure:
  5. image

To Design the Process Interaction With the TutorialJoin Control

In this step, you design the business process to call the following method on the tutorialJoin control:

join(PriceQuoteDocument _priceQuoteDoc,
AvailQuoteDocument _availQuoteDoc, float taxRate) 

This join method does the work of combining the data returned to your business process from different systems and creating a single XML response document (quote), which is subsequently returned to the business process' client.

  1. Expand the tutorialJoin control instance in the Data Palette, then click the following method:
  2. QuoteDocument join(org.example.price.PriceQuoteDocument _priceQuoteDoc,
    org.example.avail.AvailQuoteDocument _availQuoteDoc,float taxRate) 
    
  3. In the Design View, drag the method from the Data Palette and drop it on your RequestQuote business process placing it immediately after the Convert AvailList to AvailQuote XML node.
  4. Rename the node from join to Combine Price and Avail Quotes.
  5. image

  6. Double-click the Combine Price and Avail Quotes node. The node builder opens on the General Settings tab.
  7. Confirm that tutorialJoin is displayed in the Control field, and that the following method, which you dragged onto the node from the Data Palette, is selected in the Method field:
  8. QuoteDocument join(org.exampel.price.PriceQuoteDocument _priceQuoteDoc,
    org.example.avail.AvailQuoteDocument _availQuoteDoc,float taxRate 
    
  9. Click Send Data to open the second tab in the node builder.
  10. The Control Expects field is populated with the data type expected by the join method on the tutorialJoin control, as shown in the following figure:

    image

  11. Under Select variables to assign, select the variables such that their data types match the data type expected (Control Expects) in the input parameters to the join() method, as follows:
  12. Click Receive Data to open the third tab in the node builder.
  13. On the Receive Data tab, the Control Returns field is populated with QuoteDocument, which is the data type returned by the join() method.

  14. Click the arrow in Select variable to assign, then choose Create new variable.... The Create Variable dialog box is displayed.
  15. image

  16. In the Variable Name field, enter Quote.
  17. In the Select Variable Type field, select quote from the list of XML types, as shown in the following figure:
  18. image

    The Variable Type field is populated with org.example.quote.QuoteDocument.

  19. Click OK to create the new variable. The Quote variable is displayed in the Receive Data tab, and also in the XML list in the Data Palette.
  20. To close the node builder, click the X in top right-hand corner.
  21. This step completes the design of the Combine Price and Avail Quotes node. At run time, the availability quote data in XML format is assigned to the Quote variable.

  22. From the Workshop menu, select File —> Save All.
  23. To complete Part III of the tutorial, it only remains to write the quote to your file system (an optional step), and to create the Client Response node in your business process. The business process returns the quote you created to the client via the Client Response node.

    Step 10: Write Quote to File System

    Step 11: Send Quote From Business Process to Client

Related Topics

To learn how to create Transformation controls, and specifically to learn how to design the TutorialJoin.dtf control used in this section, see Tutorial: Building Your First Data Tansformation.

Previous Document Next Document