Tutorial: Building Your First Data Transformation

Data transformation is the mapping and conversion of data from one format to another. For example, XML data can be transformed from XML data valid to one XML Schema to another XML document valid to a different XML Schema. Other examples include the data transformation from non-XML data to XML data. This tutorial introduces the basics of building a data transformation by describing how to create and test a XML-to-XML data transformation using WebLogic Workshop.

In WebLogic Integration business processes, a data transformation transforms data using queries (written in the XQuery language). This tutorial describes the steps for building a query in the XQuery language—a language defined by the World Wide Web Consortium (W3C) that provides a vendor independent language for the query and retrieval of XML data.

To learn about the XQuery language, see the XQuery 1.0: An XML Query Language Specification - W3C Working Draft 16 August 2002 at the W3C web site at the following URL:

http://www.w3.org/TR/2002/WD-xquery-20020816

The WebLogic XQuery engine invoked by a business process conforms to the August 16, 2002 draft of the XQuery Specification.

To learn more about XML and XML Schemas, see Java and XML Basics.

The data transformation created in this tutorial is invoked in the RequestQuote business process. This business process is created to meet the business needs of an enterprise. The enterprise starts the business process as a result of receiving a Request for Quote from clients, checks the enterprise's inventory and pricing systems to determine whether the order can be filled, and sends a quote for the requested items to the client. To learn more about creating business processes and the RequestQuote business process, see Tutorial: Building Your First Business Process.

The following figure shows the flow of data in the RequestQuote business process of the Tutorial Process application.

image

The purpose of the RequestQuote business process is to provide price and availability information for a set of widgets. The flow of the data through the RequestQuote business process is represented by the following steps:

  1. The business process receives the set of widget IDs.
  2. The business process determines the tax rate for the shipment and puts the result in the taxRate float business process variable.
  3. The business process gets the price of each of the requested widgets from a source and places the resulting XML data into the priceQuote business process variable. (This XML data is valid to the XML Schema in the PriceQuote.xsd file.)
  4. The business process gets information about availability for the widgets from another source and places the resulting XML data into the availQuote business process variable. (This XML data is valid to the XML Schema in the AvailQuote.xsd file.)
  5. The business process invokes the Combine Price and Avail Quotes node. The Combine Price and Avail Quotes node calls the myJoin Transformation method stored in the Transformation file called MyTutorialJoin.dtf file. The business process passes the values of the priceQuote, availQuote, and taxRate business process variables to the myJoin method. The myJoin method invokes the query written in the XQuery language and stored in the myJoin.xq file. The query merges all the price, availability, and tax rate information into a single set of XML data and returns the result as the return value of the myJoin method. The data returned from this myJoin method is valid to the XML Schema in the Quote.xsd file. After the myJoin method is invoked, the Combine Price and Avail Quotes node assigns the resulting XML data to the Quote business process variable.

Tutorial Goals

The tutorial provides steps to create and test a transformation using the graphical environment provided in WebLogic Workshop. Specifically, in this tutorial you will create the following:

Steps in This Tutorial

Follow the steps in this tutorial to create and test a data transformation. Specifically, the steps include:


Next Document