![]() ![]() ![]() ![]() ![]() ![]() |
In this step, you create a transformation that contains the mapping of different source (input) types to a single target (output) type. Specifically, this tutorial provides the steps for transforming a Java primitive and two sets of XML data (valid to two different schemas) to a single set of XML data valid to a third schema, as shown in the following figure.
The RequestQuote business process takes as input a set of widget IDs and returns the price and availability of these widget IDs.
The source parameters to the myJoin
Transformation method include the following:
PriceQuote.xsd
file. The RequestQuote business process of the Tutorial Process application builds a piece of XML data that is valid to the PriceQuote.xsd
XML Schema and stores it in a business process variable called priceQuote
. This piece of XML data contains a set of widget IDs and their price.AvailQuote.xsd
file. The RequestQuote business process of the Tutorial Process application builds a piece of XML data that is valid to the AvailQuote.xsd
XML Schema and stores it in a business process variable called availQuote
. This piece of XML data contains a set of widget IDs, a boolean that represents if the widget is available, and the ship date.taxRate
.
The myJoin
Transformation method takes these source parameters and invokes a query which merges the price, availability, and tax rate information into one piece of XML data valid to the XML Schema in the Quote.xsd
file.
The tasks in this step include:
In this task, you create a Transformation file called MyTutorialJoin.java
. In addition, you create a Transformation method in the Transformation file. During run time, the business process will call this method to invoke the transformation.
The MytutorialJoin.java
is created under the src
requestquote
folder.
Note: | To alternatively create Transformation, click the drop down arrow in the Data Palette view, select Integration Controls, and then Transformation Control. |
MyTutorialJoin.java
.MyTutorialJoin.java
Source pane that is displayed.myJoin
as the Transformation Method Name, and myJoin.xq
as the XQuery File Name. You can also accept the default values, and click Next. In this task, you select the source types for the transformation in the Source Types dialog box of New XQuery Transformation wizard. Source types are the input data types for the transformation—the data types that are transformed to the target data type.
Note: | If these files are not listed, you probably have not loaded the Tutorial: Process Application. For instructions on loading this application, see To Load The Tutorial Process Application. |
The elements and attributes that make up the priceQuote element are displayed in the Selected Source Types pane.
The elements and attributes that make up the availQuote element are displayed in the Selected Source Types pane.
The available Java Types are displayed in the Available Source Types pane.
taxRate
as the Parameter Name.In this task, you select a target type for the transformation in the Target Types dialog box of New XQuery Transformation.
PriceQuote.xsd
, AvailQuote.xsd
, Quote.xsd
, and QuoteRequest.xsd
files are listed.The elements and attributes that make up the quote element are displayed in the Selected Target Types pane.
The file: myJoin.xq
is created and displayed in the Design view.
The myJoin
Transformation method is added to MyTutorialJoin Transformation file. The myJoin
method contains the three source parameters selected from priceQuote.xsd, availQuote.xsd, and the float java type.
In the Package Explorer pane, representations of the MyTutorialJoin.java and myJoin.xq files are displayed as shown in the following figure.
![]() ![]() ![]() |