Tutorial: Building Your First Data Transformation

     Previous  Next    Open TOC in new window    View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

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 BEA WorkSpace Studio.

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 Recommendation 23 January 2007 .

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.

Figure 1-1 Representing Flow of Data

Representing Flow of Data

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.java 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 BEA Workshop for WebLogic Platform. 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:

Step 1: Getting Started

Describes how to load the prepackaged Tutorial Process Application.

Step 2: Building the Transformation

Provides a step-by-step procedure to create and select source and target types for a Transformation method.

Step 3: Mapping Elements and Attributes

Provides a step-by-step procedure to create mappings between source and target elements and attributes in a Transformation method.

Step 4: Mapping Repeating Elements—Creating a Join

Provides a step-by-step procedure to add a join between repeating elements to the Transformation method.

  Back to Top       Previous  Next