using websphere transformation extender v8.2 with websphere …€¦ ·  · 2010-01-15extender...

33
Using WebSphere Transformation Extender V8.2 with WebSphere Process Server and WebSphere ESB V6.1, Part 1: Generating the WTX maps for use with WebSphere Process Server and WebSphere ESB Skill Level: Intermediate Dave Mulley ([email protected]) IT Specialist IBM 09 Jul 2008 This tutorial series shows you how to create IBM® WebSphere® Transformation Extender maps using the WebSphere WebSphere Transformation Extender V8.2 Design Studio and steps you through the configuration required in WebSphere Integration Developer V6.1 to use the WebSphere Transformation Extender Data Binding with Java™ Message Service (JMS) and the WebSphere Adapter for Flat Files. Section 1. Before you start This tutorial series is a step-by-step guide that covers the creation of WebSphere Transformation Extender maps using the WTX V8.2 Design Studio and the configuration required in WebSphere Integration Developer V6.1 to use the WebSphere Transformation Extender Data Binding with JMS and the WebSphere Adapter for Flat Files. This document describes the steps required to: Use the “Map Generator for WESB/WPS” Wizard. Generating the WTX maps for use with WebSphere Process Server and WebSphere ESB © Copyright IBM Corporation 1994, 2008. All rights reserved. Page 1 of 33

Upload: truongquynh

Post on 12-May-2018

277 views

Category:

Documents


7 download

TRANSCRIPT

Page 1: Using WebSphere Transformation Extender V8.2 with WebSphere …€¦ ·  · 2010-01-15Extender maps using the WebSphere WebSphere Transformation Extender V8.2 ... • WebSphere Transformation

Using WebSphere Transformation Extender V8.2with WebSphere Process Server and WebSphereESB V6.1, Part 1: Generating the WTX maps foruse with WebSphere Process Server andWebSphere ESBSkill Level: Intermediate

Dave Mulley ([email protected])IT SpecialistIBM

09 Jul 2008

This tutorial series shows you how to create IBM® WebSphere® TransformationExtender maps using the WebSphere WebSphere Transformation Extender V8.2Design Studio and steps you through the configuration required in WebSphereIntegration Developer V6.1 to use the WebSphere Transformation Extender DataBinding with Java™ Message Service (JMS) and the WebSphere Adapter for FlatFiles.

Section 1. Before you start

This tutorial series is a step-by-step guide that covers the creation of WebSphereTransformation Extender maps using the WTX V8.2 Design Studio and theconfiguration required in WebSphere Integration Developer V6.1 to use theWebSphere Transformation Extender Data Binding with JMS and the WebSphereAdapter for Flat Files.

This document describes the steps required to:

• Use the “Map Generator for WESB/WPS” Wizard.

Generating the WTX maps for use with WebSphere Process Server and WebSphere ESB© Copyright IBM Corporation 1994, 2008. All rights reserved. Page 1 of 33

Page 2: Using WebSphere Transformation Extender V8.2 with WebSphere …€¦ ·  · 2010-01-15Extender maps using the WebSphere WebSphere Transformation Extender V8.2 ... • WebSphere Transformation

• Complete a simple WebSphere Transformation Extender Map.

• Export the WebSphere Transformation Extender runtime components toWebSphere Integration Developer.

When you complete this tutorial, you'll have a WebSphere Integration DeveloperLibrary that contains the WebSphere Transformation Extender resources that arerequired by the WebSphere ESB and WebSphere Process Server runtime toperform transformations.

Prerequisites

You should install the following prerequisites prior to beginning this tutorial:

• WebSphere Integration Developer V6.1 with all current iFixes installed

• WebSphere Process Server V6.1 User Test Environment with all currentiFixes installed

• WebSphere Transformation Extender V8.2 Design Studio with all currentiFixes

• WebSphere Transformation Extender V8.2 “for Integration Servers” withall current iFixes

Section 2. Introduction

This tutorial is part of a “How-to” tutorial series that has been written to assistarchitects, system administrators, or developers that need to develop WebSphereEnterprise Service Bus (WESB) or WebSphere Process Server modules that invokeWebSphere Transformation Extender V8.x maps using the WebSphere ESB andWebSphere Process Server V6.1 WebSphere Transformation Extender DataBinding.

In this tutorial, you'll create WebSphere Transformation Extender maps using theWebSphere Transformation Extender V8.2 Design Studio and the configurationrequired in WebSphere Integration Developer V6.1 to use the WebSphereTransformation Extender Data Binding with JMS and the WebSphere Adapter forFlat Files.

Prerequisites

developerWorks® ibm.com/developerWorks

Generating the WTX maps for use with WebSphere Process Server and WebSphere ESBPage 2 of 33 © Copyright IBM Corporation 1994, 2008. All rights reserved.

Page 3: Using WebSphere Transformation Extender V8.2 with WebSphere …€¦ ·  · 2010-01-15Extender maps using the WebSphere WebSphere Transformation Extender V8.2 ... • WebSphere Transformation

The following prerequisites should be installed prior to beginning this document:

• WebSphere Integration Developer V6.1 with all current iFixes installed

• WebSphere Process Server V6.1 User Test Environment with all currentiFixes installed

• WebSphere Transformation Extender V8.2 Design Studio with all currentiFixes

• WebSphere Transformation Extender V8.2 “for Integration Servers” withall current iFixes

WebSphere Transformation Extender V8.2 Installation Notes

This tutorial series assumes that WebSphere Transformation Extender V8.2 DesignStudio and WebSphere Transformation Extender V8.2 “for Integration Servers” havebeen installed on the same machine as WebSphere Integration Developer V6.1

In order to have access to the WebSphere Transformation Extender DevelopmentPerspective in WebSphere Integration Developer V6.1, you must ensure that theWebSphere Transformation Extender Design Studio link file has been copied by theWebSphere Transformation Extender V8.2 Design Studio Installer into the correctWID directory. The diagram below shows the WebSphere TransformationExtender_es.link file in a links directory in the base directory of the WebSphereIntegration Developer installation.

Figure 1. WTX Design Studio link file in the correct WID directory

If this file has not been copied by the WebSphere Transformation Extender V8.2Design Studio installer into the <WID_Install_Path>\links directory (or if the<WID_Install_Path>\links directory does not exist), you must copy it from the<WTXInstallPath> \wtx_eclipse\eclipse\links directory into the

ibm.com/developerWorks developerWorks®

Generating the WTX maps for use with WebSphere Process Server and WebSphere ESB© Copyright IBM Corporation 1994, 2008. All rights reserved. Page 3 of 33

Page 4: Using WebSphere Transformation Extender V8.2 with WebSphere …€¦ ·  · 2010-01-15Extender maps using the WebSphere WebSphere Transformation Extender V8.2 ... • WebSphere Transformation

<WID_Install_Path>\links directory. WebSphere Integration Developer must berestarted using the –clean option to ensure the WebSphere TransformationExtender Development Perspective is available for use.

The classes used by WebSphere Process Server V6.1 at runtime to invokeWebSphere Transformation Extender Maps are not shipped with either WebSphereProcess Server or the WebSphere Transformation Extender Design Studio. Theyare shipped only with WebSphere Transformation Extender V8.2 “for IntegrationServers”. During the installation of WebSphere Transformation Extender V8.2 “forIntegration Servers” the com.ibm.wtx.runtime_8.2.0.jar file is copied into the<WID_Install_Path>\runtimes\bi_v61\plugins directory.

Figure 2. WebSphere Transformation Extender runtime library in the correctWID directory

If this file has not been copied by the WebSphere Transformation Extender V8.2 “forIntegration Servers” Installer, you must copy the file manually from the<WTXInstallPath> directory. The WebSphere Process Server server must berestarted in order to load this library for use.

Section 3. Scenario overview

In this tutorial series, you integrate WebSphere Process Server with an application(via Flat File and JMS) that uses a delimited data format (an example of the data isshown below).

Customer,10,John,Doe

The data can be represented as the Business Object shown below.

Figure 3. Customer Business Object

developerWorks® ibm.com/developerWorks

Generating the WTX maps for use with WebSphere Process Server and WebSphere ESBPage 4 of 33 © Copyright IBM Corporation 1994, 2008. All rights reserved.

Page 5: Using WebSphere Transformation Extender V8.2 with WebSphere …€¦ ·  · 2010-01-15Extender maps using the WebSphere WebSphere Transformation Extender V8.2 ... • WebSphere Transformation

The first element in the delimited format is the datatype (value=Customer) followedby the id (value=10), firstName (value=John) and the lastName (value=Doe).

In previous versions of WebSphere Process Server and WebSphere ESB, this typeof integration would have required a custom coding either in the form of a customdata binding or Java snippet. This tutorial series shows you how to achieve thisintegration in WebSphere Process Server and WebSphere ESB V6.1 without theneed for any custom coding.

In this first part of the tutorial series, you will create the WebSphere TransformationExtender maps necessary to transform data from the delimited format to a BusinessObject and from a Business Object to the delimited format to ensure that theintegration between WebSphere Process Server, WebSphere ESB, and theapplication is bi-directional. In the second part of the tutorial series, you willconfigure the Flat File adapter to use the WebSphere Transformation Extender databinding and maps and demonstrate bi-directional Flat File integration with theapplication. In the third part of the tutorial series, you will configure JMS imports andexports to use the WebSphere Transformation Extender data binding and maps todemonstrate JMS integration.

Figure 4. Diagram showing the use of the WebSphere TransformationExtender Data Binding on an Export

Figure 5. Diagram showing the use of the WebSphere TransformationExtender Data Binding on an Import

ibm.com/developerWorks developerWorks®

Generating the WTX maps for use with WebSphere Process Server and WebSphere ESB© Copyright IBM Corporation 1994, 2008. All rights reserved. Page 5 of 33

Page 6: Using WebSphere Transformation Extender V8.2 with WebSphere …€¦ ·  · 2010-01-15Extender maps using the WebSphere WebSphere Transformation Extender V8.2 ... • WebSphere Transformation

Section 4. Scenario instructions

In this section, you will use WebSphere Integration Developer V6.1 and WebSphereTransformation Extender V8.2 Design Studio to generate the “Delimted to BusinessObject” and the “Business Object to Delimited” WebSphere Transformation Extendertransformation maps and add them to a WebSphere Integration Developer V6.1Library ready for use with the WebSphere Adapter for Flat Files and JMS.

Create Customer Business Object and Library

You can begin by using WebSphere Integration Developer V6.1 to create a Librarywith the name WTXLib and a Business Object with the name Customer.

1. Create a new Library in the Business Integration Perspective with thename WTXLib

2. Create a new Business Object with the name Customer in thenamespace http://www.ibm.com as shown below .Figure 6. Customer Business Object

developerWorks® ibm.com/developerWorks

Generating the WTX maps for use with WebSphere Process Server and WebSphere ESBPage 6 of 33 © Copyright IBM Corporation 1994, 2008. All rights reserved.

Page 7: Using WebSphere Transformation Extender V8.2 with WebSphere …€¦ ·  · 2010-01-15Extender maps using the WebSphere WebSphere Transformation Extender V8.2 ... • WebSphere Transformation

Tip: The namespace must be set to of http://www.ibm.com as that wasthe namespace that was used when generating the pre-built artifacts thatyou will import later.

Copy the Customer Business Object XSD into a WebSphereTransformation Extender Project

In this section, you will copy the XSD file that contains the Customer BusinessObject definition into a new WebSphere Transformation Extender Project.

1. Switch to the Transformation Extender Development Perspective.

2. Create a new Transformation Extender Project with the name

ibm.com/developerWorks developerWorks®

Generating the WTX maps for use with WebSphere Process Server and WebSphere ESB© Copyright IBM Corporation 1994, 2008. All rights reserved. Page 7 of 33

Page 8: Using WebSphere Transformation Extender V8.2 with WebSphere …€¦ ·  · 2010-01-15Extender maps using the WebSphere WebSphere Transformation Extender V8.2 ... • WebSphere Transformation

CustomerMapProject.

3. Create a new folder named WTX in the CustomerMapProject project.

4. Switch to the Navigator Tab in the Transformation ExtenderDevelopment Perspective and validate that the CustomerMapProjectcontains a WTX folder.

5. Copy the Customer.xsd file from WTXLib and paste it into the WTXfolder of the CustomerMapProject. (DO NOT DRAG AND DROP. YOUMUST USE CUT AND PASTE). Validate that the CustomerMapProject isthe same as shown below in Figure 7.Figure 7. CustomerMapProject

Run the Map Generator for WPS/WESB Wizard

Now, you can use the Map Generator for WPS/WESB Wizard to create theCustomerXMLToDelimited and CustomerDelimitedToXML WTX Maps.

1. Switch back to the Extender Navigator Tab in the TransformationExtender Development Perspective.

2. Right-click on the CustomerMapProject and start the Map Generatorfor WPS/WESB wizard.Figure 8. Start the Map Generator for WESB/WPS Wizard

developerWorks® ibm.com/developerWorks

Generating the WTX maps for use with WebSphere Process Server and WebSphere ESBPage 8 of 33 © Copyright IBM Corporation 1994, 2008. All rights reserved.

Page 9: Using WebSphere Transformation Extender V8.2 with WebSphere …€¦ ·  · 2010-01-15Extender maps using the WebSphere WebSphere Transformation Extender V8.2 ... • WebSphere Transformation

3. Use the … button for BO Schema Location to browse to the<Workspace>\CustomerMapProject\WTX folder on your file system andselect the Customer.xsd file.

4. Verify that the BO Type is set to Customer (http://www.ibm.com)Tip: If your BO Type is set to Customer (http://WTXLib) then you didnot complete Step 2 in the previous section correctly and must correctthe namespace for the Business Object before continuing.

5. Enter Delimited for the Content Type and click Next.Figure 9. Map Generator Wizard – Page 1

Figure 9. Map Generator Wizard – Page 1

6. Verify that both the XML to Native Map and Native to XML Map optionsare selected to ensure that the wizard creates the input and output maps.

7. Select the CustomerMapProject as the destination folder and clickNext.

ibm.com/developerWorks developerWorks®

Generating the WTX maps for use with WebSphere Process Server and WebSphere ESB© Copyright IBM Corporation 1994, 2008. All rights reserved. Page 9 of 33

Page 10: Using WebSphere Transformation Extender V8.2 with WebSphere …€¦ ·  · 2010-01-15Extender maps using the WebSphere WebSphere Transformation Extender V8.2 ... • WebSphere Transformation

Figure 10. Map Generator Wizard – Page 2 – Destination Folder'

8. When the input and output cards and the maps have been built, ClickFinish to end the wizard.

Review the generated artifacts

You can now review the artifacts that have been generated by the Map Generatorfor WPS/WESB Wizard.

The Map Generator Wizard generated a new XSD file with the nameCustomerDelimited.xsd that contains the top level element definition that isrequired by WebSphere Transformation Extender.

1. Open the Schema Files folder in the Extender Navigator.

2. Right-click CustomerDelimited.xsd and select Open With => TextEditor as shown below in Figure 11.Figure 11. Opening CustomerDelimited.xsd in a Text Editor

3. Examine the contents of the file.

4. Close the Text Editor.The Map Generator Wizard generated a map source file with the nameCustomerDelimited.mms which contains two maps(CustomerDelimitedToXML and CustomerXMLToDelimited).

developerWorks® ibm.com/developerWorks

Generating the WTX maps for use with WebSphere Process Server and WebSphere ESBPage 10 of 33 © Copyright IBM Corporation 1994, 2008. All rights reserved.

Page 11: Using WebSphere Transformation Extender V8.2 with WebSphere …€¦ ·  · 2010-01-15Extender maps using the WebSphere WebSphere Transformation Extender V8.2 ... • WebSphere Transformation

5. Open the Maps folder in the Extender Navigator.

6. Double-click on the CustomerDelimited.mms Map Source File to openit in the Map Editor. Notice that Figure 12 shows theCustomerXMLToDelimited map displayed in the Map Editor. This mapwill be used to transform data from the Customer Business Object formatto the delimited format.Figure 12. The CustomerXMLToDelimited Map

7. Use the Outline Viewer to display the CustomerDelimitedToXML mapin the Map Editor by double-clicking on CustomerDelimitedToXML.Figure 13. The Outline Viewer with CustomerDelimitedToXMLhighlighted

Notice that the CustomerDelimitedToXML map is displayed in the MapEditor. This map will be used to transform data from the delimited formatto the Customer Business Object format.

Figure 14. CustomerDelimitedToXML Map

ibm.com/developerWorks developerWorks®

Generating the WTX maps for use with WebSphere Process Server and WebSphere ESB© Copyright IBM Corporation 1994, 2008. All rights reserved. Page 11 of 33

Page 12: Using WebSphere Transformation Extender V8.2 with WebSphere …€¦ ·  · 2010-01-15Extender maps using the WebSphere WebSphere Transformation Extender V8.2 ... • WebSphere Transformation

Import the Delimited Type Tree

The Type Tree that defines the delimited data has been provided for you. In thissection you will import the Type Tree into the CustomerMapProject ready for use inthe newly created Maps.

1. Use a File System Import to import the Type Tree that representsdelimited (delimitedCustomer.mtt) version of Customer from the<LabFiles>\Type_Trees directory into the CustomerMapProject folder.The result should be as shown in Figure 17.Figure 15. The newly imported Type Tree is visible in the ExtenderNavigator

Review the CustomerXML Input and Output Cards

The inputs and outputs of a WebSphere Transformation Extender Map are definedusing Cards. In this section you will review the automatically generated Cards that

developerWorks® ibm.com/developerWorks

Generating the WTX maps for use with WebSphere Process Server and WebSphere ESBPage 12 of 33 © Copyright IBM Corporation 1994, 2008. All rights reserved.

Page 13: Using WebSphere Transformation Extender V8.2 with WebSphere …€¦ ·  · 2010-01-15Extender maps using the WebSphere WebSphere Transformation Extender V8.2 ... • WebSphere Transformation

represent the XML data.

1. Expand the contents of the Outline Viewer and note that theCustomerDelimitedToXML map has an automatically generated OutputCard (CustomerXML) and that the CustomerXMLToDelimited map hasan automatically generated Input Card (CustomerXML).Figure 16. Expanded Outline Viewer

2. Right-click on the CustomerXML Output Card of theCustomerDelimitedToXML map and select Edit.

3. Examine the card. This Output Card tells WebSphere TransformationExtender to create an XML document using the CustomerDelimited XMLSchema. Notice that the TypeTree for this card is set toCustomerDelimited.xsd and that the same file is used to provideMetadata (that determines the Name Spaces that will be generated atruntime).Figure 17. CustomerXML Output Card

Figure 17. CustomerXML Output Card

ibm.com/developerWorks developerWorks®

Generating the WTX maps for use with WebSphere Process Server and WebSphere ESB© Copyright IBM Corporation 1994, 2008. All rights reserved. Page 13 of 33

Page 14: Using WebSphere Transformation Extender V8.2 with WebSphere …€¦ ·  · 2010-01-15Extender maps using the WebSphere WebSphere Transformation Extender V8.2 ... • WebSphere Transformation

4. Click Cancel on the Edit Output Card dialog

5. Right-click on the CustomerXML Input Card of theCustomerXMLToDelimited map and select Edit.

6. Examine the card. This Input Card tells WebSphere TransformationExtender to expect an XML document that conforms to theCustomerDelimited XML Schema as input at runtime. Notice that theTypeTree for this card is set to CustomerDelimited.xsd and that thesame file is used to provide Metadata (that determines the Name Spacesthat should be expected at runtime). The other value of note here is theFetchAs = Integral value that specifies the internal technology thatWebSphere Transformation Extender should use when processing theinput data.Figure 18. CustomerXML Input Card

developerWorks® ibm.com/developerWorks

Generating the WTX maps for use with WebSphere Process Server and WebSphere ESBPage 14 of 33 © Copyright IBM Corporation 1994, 2008. All rights reserved.

Page 15: Using WebSphere Transformation Extender V8.2 with WebSphere …€¦ ·  · 2010-01-15Extender maps using the WebSphere WebSphere Transformation Extender V8.2 ... • WebSphere Transformation

7. Click Cancel on the Edit Input Card dialog

Create the CustomerDelimited Input Card

The CustomerDelimitedToXML Map requires an Input Card that tells WebSphereTransformation Extender to expect input data that conforms to theCustomerDelimited.mtt Type Tree. In this section you will create a new Input Cardfor the CustomerDelimitedToXML Map and set some required values.

1. Right-click on Input Cards of the CustomerDelimitedToXML map in theOutline Viewer and select New as shown in Figure 19.Figure 19. Create a new Input Card for the CustomerDelimitedToXMLmap

ibm.com/developerWorks developerWorks®

Generating the WTX maps for use with WebSphere Process Server and WebSphere ESB© Copyright IBM Corporation 1994, 2008. All rights reserved. Page 15 of 33

Page 16: Using WebSphere Transformation Extender V8.2 with WebSphere …€¦ ·  · 2010-01-15Extender maps using the WebSphere WebSphere Transformation Extender V8.2 ... • WebSphere Transformation

2. Set the CardName to CustomerDelimited

3. Set the TypeTree to the delimitedCustomer.mtt file by clicking in theTypeTree input box and then clicking the … button as shown in Figure 20.Navigate to the delimitedCustomer.mtt file in the Project Browser andthen click OK. The result should be as shown in Figure 21.Figure 20. TypeTree Browse button

Figure 21. TypeTree value set correctly

4. Set the Type to Record0 Record Data by clicking in the Type input boxand then clicking the … button as shown in Figure 22. Navigate to theRecord0 attribute in the Select Type dialog as shown in Figure 23 andthen click OK. The result should be as shown in Figure 24.Figure 22. Type Browse button

developerWorks® ibm.com/developerWorks

Generating the WTX maps for use with WebSphere Process Server and WebSphere ESBPage 16 of 33 © Copyright IBM Corporation 1994, 2008. All rights reserved.

Page 17: Using WebSphere Transformation Extender V8.2 with WebSphere …€¦ ·  · 2010-01-15Extender maps using the WebSphere WebSphere Transformation Extender V8.2 ... • WebSphere Transformation

Figure 23. Selecting Record0

Figure 24. Type value set correctly

5. Set the GET Source to Application by clicking in the Source input boxand using the drop-down list to select Application.

6. Set the GET Source Command to -Overridden by typing in the inputbox. The result should be as shown in Figure 25.Figure 25. Command value set correctly

ibm.com/developerWorks developerWorks®

Generating the WTX maps for use with WebSphere Process Server and WebSphere ESB© Copyright IBM Corporation 1994, 2008. All rights reserved. Page 17 of 33

Page 18: Using WebSphere Transformation Extender V8.2 with WebSphere …€¦ ·  · 2010-01-15Extender maps using the WebSphere WebSphere Transformation Extender V8.2 ... • WebSphere Transformation

7. Click OK on the New Input Card Dialog

Create the CustomerDelimited Output Card

The CustomerXMLToDelimited Map requires an Output Card that tells WebSphereTransformation Extender to create output data that conforms to theCustomerDelimited.mtt Type Tree. In this section you will create a new OutputCard for the CustomerXMLToDelimtied Map and set some required values.

1. Right-click Output Cards of the CustomerXMLToDelimited map in theOutline Viewer and select New.

2. Set the CardName to CustomerDelimited

3. Set the TypeTree to the delimitedCustomer.mtt file by clicking in theTypeTree input box and then clicking the … button as shown in Figure 26.Navigate to the delimitedCustomer.mtt file in the Project Browser (asshown in Figure 35) and then click OK. The result should be as shown inFigure 27.Figure 26. TypeTree Browse butto

Figure 27. TypeTree value set correctly

developerWorks® ibm.com/developerWorks

Generating the WTX maps for use with WebSphere Process Server and WebSphere ESBPage 18 of 33 © Copyright IBM Corporation 1994, 2008. All rights reserved.

Page 19: Using WebSphere Transformation Extender V8.2 with WebSphere …€¦ ·  · 2010-01-15Extender maps using the WebSphere WebSphere Transformation Extender V8.2 ... • WebSphere Transformation

4. Set the Type to Record0 Record Data by clicking in the Type input boxand then clicking the … button as shown in Figure 27. Navigate to theRecord0 attribute in the Select Type dialog as shown in Figure 28 andthen click OK. The result should be as shown in Figure 29.Figure 27. Type Browse button

Figure 27. Type Browse button

Figure 28. Selecting Record0

Figure 29. Type value set correctly

5. Set the PUT Target to Application by clicking in the Target input boxand using the drop-down list to select Application. The result should beas shown in Figure 41.Figure 30. Target value set correctly

ibm.com/developerWorks developerWorks®

Generating the WTX maps for use with WebSphere Process Server and WebSphere ESB© Copyright IBM Corporation 1994, 2008. All rights reserved. Page 19 of 33

Page 20: Using WebSphere Transformation Extender V8.2 with WebSphere …€¦ ·  · 2010-01-15Extender maps using the WebSphere WebSphere Transformation Extender V8.2 ... • WebSphere Transformation

6. Set the PUT Target Command to -Overridden by typing in the input box.The result should be as shown in Figure 31.Figure 31. Command value set correctly

7. Click OK on the New Output Card Dialog

8. Verify that your CustomerDelimited Map now matches the configurationshown below in Figure 32 and then Save your changes.Figure 32. Completed Map Cards

developerWorks® ibm.com/developerWorks

Generating the WTX maps for use with WebSphere Process Server and WebSphere ESBPage 20 of 33 © Copyright IBM Corporation 1994, 2008. All rights reserved.

Page 21: Using WebSphere Transformation Extender V8.2 with WebSphere …€¦ ·  · 2010-01-15Extender maps using the WebSphere WebSphere Transformation Extender V8.2 ... • WebSphere Transformation

Complete the CustomerDelimitedToXML Map

Now that the CustomerDelimitedToXML Map has an Input Card and an Output Card,the data mappings that transform data from the delimited format into the XMLformat can be completed.

1. Double-click the CustomerDelimitedToXML map in the Outline Viewerto open the map in the main editor window. The main editor window isshown below in Figure 33.Figure 33. CustomerDelimitedToXML map open in the main editorwindow

ibm.com/developerWorks developerWorks®

Generating the WTX maps for use with WebSphere Process Server and WebSphere ESB© Copyright IBM Corporation 1994, 2008. All rights reserved. Page 21 of 33

Page 22: Using WebSphere Transformation Extender V8.2 with WebSphere …€¦ ·  · 2010-01-15Extender maps using the WebSphere WebSphere Transformation Extender V8.2 ... • WebSphere Transformation

The main editor window is split into two sections: Rules (upper) andMappings (lower). For this tutorial we are only interested in themappings section. The mappings section shows the From Type Tree(left) and the To Type Tree (Right). In the next few steps we will beusing a simple drag-and-drop methodology to complete the mappingsbetween the two Type Trees.

2. Expand the CustomerDelimited tree and the CustomerXML type treesby right-clicking on the top element of the type tree (CustomerDelimitedand CustomerXML) in the mappings section and selecting Show All fromthe menu as shown below in Figure 34 and Figure 35.Figure 34. Expanding the CustomerDelimited Type Tree

Figure 35. Expanding the CustomerXML Type Tree

developerWorks® ibm.com/developerWorks

Generating the WTX maps for use with WebSphere Process Server and WebSphere ESBPage 22 of 33 © Copyright IBM Corporation 1994, 2008. All rights reserved.

Page 23: Using WebSphere Transformation Extender V8.2 with WebSphere …€¦ ·  · 2010-01-15Extender maps using the WebSphere WebSphere Transformation Extender V8.2 ... • WebSphere Transformation

There is a section of the CustomerXML Type Tree that is used byWebSphere Transformation Extender to generate the <xml> line atbeginning of the XML document that it creates. It is necessary tohardcode values into the fields in the Prolog section so that the <xml>line is created correctly.

3. Select the version field in the Prolog (0:1) section of the CustomerXMLtype tree and enter =”1.0”Figure 36. Populating the version field

ibm.com/developerWorks developerWorks®

Generating the WTX maps for use with WebSphere Process Server and WebSphere ESB© Copyright IBM Corporation 1994, 2008. All rights reserved. Page 23 of 33

Page 24: Using WebSphere Transformation Extender V8.2 with WebSphere …€¦ ·  · 2010-01-15Extender maps using the WebSphere WebSphere Transformation Extender V8.2 ... • WebSphere Transformation

4. Select the encoding (0:1) field in the Prolog (0:1) section of theCustomerXML type tree and enter =”UTF-8”.

5. Select the standalone (0:1) field in the Prolog (0:1) section of theCustomerXML type tree and enter =”no”.

6. Right-click the pcdata (0:1) field in the misc (0:1) Elem section andselect Insert NONE from the menu. Validate that the CustomerXML TypeTree now looks like Figure 37.Figure 37. CustomerXML Type Tree

Now that the constant values have been set, the next step is to completethe mappings that will move data from the CustomerDelimited TypeTree to the CustomerXML Type Tree. We will use drag-and-drop tocreate the mapping rules.

7. Select the id Field line in the CustomerDelimited type tree and drag anddrop it onto the id (0:1) line in global Customer sequence section of the

developerWorks® ibm.com/developerWorks

Generating the WTX maps for use with WebSphere Process Server and WebSphere ESBPage 24 of 33 © Copyright IBM Corporation 1994, 2008. All rights reserved.

Page 25: Using WebSphere Transformation Extender V8.2 with WebSphere …€¦ ·  · 2010-01-15Extender maps using the WebSphere WebSphere Transformation Extender V8.2 ... • WebSphere Transformation

CustomerXML type tree as shown in Figure 38. The result should be asshown in Figure 39.Figure 38. Drag-and-drop mapping from CustomerDelimited toCustomerXML

Figure 39. id (0:1) mapping

8. Select the firstName Field line in the CustomerDelimited type tree anddrag and drop it onto the firstName (0:1) line in global Customersequence section of the CustomerXML tree.

9. Select the lastName Field line in the CustomerDelimited type tree anddrag and drop it onto the lastName (0:1) line in global Customersequence section of the CustomerXML tree. Validate that theCustomerXML Type Tree now looks like Figure 40.Figure 40. Complete CustomerXML Mapping

ibm.com/developerWorks developerWorks®

Generating the WTX maps for use with WebSphere Process Server and WebSphere ESB© Copyright IBM Corporation 1994, 2008. All rights reserved. Page 25 of 33

Page 26: Using WebSphere Transformation Extender V8.2 with WebSphere …€¦ ·  · 2010-01-15Extender maps using the WebSphere WebSphere Transformation Extender V8.2 ... • WebSphere Transformation

10. Save your changes.

Complete the CustomerXMLToDelimited Map

Now that the CustomerXMLToDelimited Map has an Input Card and an Output Card,the data mappings that transform data from the XML format into the delimitedformat can be completed.

1. Double-click the CustomerXMLToDelimted map in the Outline Viewerto open the map in the main editor window.

2. Expand the CustomerXML tree and the CustomerDelimited type treesby right-clicking on the top element of the type tree (CustomerXML andCustomerDelimited) in the mappings section and selecting Show All fromthe menu.The delimited format has a BOName field that needs to be hard coded to

developerWorks® ibm.com/developerWorks

Generating the WTX maps for use with WebSphere Process Server and WebSphere ESBPage 26 of 33 © Copyright IBM Corporation 1994, 2008. All rights reserved.

Page 27: Using WebSphere Transformation Extender V8.2 with WebSphere …€¦ ·  · 2010-01-15Extender maps using the WebSphere WebSphere Transformation Extender V8.2 ... • WebSphere Transformation

“Customer”.

3. Enter the text =”Customer” in the BOName field of theCustomerDelimited tree as shown in Figure 41.Figure 41. CustomerDelimited Type Tree with BOName value hardcoded

4. Select the id (0:1) line in global Customer sequence section of theCustomerXML type tree and drag and drop it onto the id Field line inthe CustomerDelimited tree as shown in Figure 42. The result should beas shown in Figure 43.Figure 42. Drag-and-drop mapping from CustomerXML toCustomerDelimited

Figure 43. id mapping

ibm.com/developerWorks developerWorks®

Generating the WTX maps for use with WebSphere Process Server and WebSphere ESB© Copyright IBM Corporation 1994, 2008. All rights reserved. Page 27 of 33

Page 28: Using WebSphere Transformation Extender V8.2 with WebSphere …€¦ ·  · 2010-01-15Extender maps using the WebSphere WebSphere Transformation Extender V8.2 ... • WebSphere Transformation

5. Select the firstName (0:1) line in global Customer sequence section ofthe CustomerXML type tree and drag and drop it onto the firstNameField line in the CustomerDelimited tree.

6. Select the lastName (0:1) line in global Customer sequence section ofthe CustomerXML type tree and drag and drop it onto the lastNameField line in the CustomerDelimited tree. Validate that the CustomerType Tree now looks like Figure 54.Figure 44. Completed CustomerDelimited mapping

7. Save your changes.

Build the Map Executables

Now that the data transformation mappings have been completed for both theCustomerXMLToDelimited and the CustomerDelimitedToXML maps, it isnecessary to Build the Map Executable files.

This can be thought of as compiling the map source into an executable format.

The result of this task will be two .mmc files (CustomerDelimitedToXML.mmc andCustomerXMLToDelimited.mmc) that are the map executables.

1. Double-click the CustomerDelimitedToXML map in the Outline Viewerto open the map in the main editor window.

2. Right-click on CustomerDelimitedToXML map in the Outline Viewerand select Build.

3. Double-click the CustomerXMLToDelimited map in the Outline Viewerto open the map in the main editor window.

developerWorks® ibm.com/developerWorks

Generating the WTX maps for use with WebSphere Process Server and WebSphere ESBPage 28 of 33 © Copyright IBM Corporation 1994, 2008. All rights reserved.

Page 29: Using WebSphere Transformation Extender V8.2 with WebSphere …€¦ ·  · 2010-01-15Extender maps using the WebSphere WebSphere Transformation Extender V8.2 ... • WebSphere Transformation

4. Right-click on CustomerDelimitedToXML map in the Outline Viewerand select Build.

5. Verify that the Map Executables have been created in the MapExecutables folder of the Extender Navigator.Figure 45. Map Executables

Update WTXLib

In this section you will copy the artifacts that are required at runtime from theWebSphere Transformation Extender development to the WTXLib Library.

The generated CustomerDelimted.xsd file that contains XSD definition that wasused for the CustomerXML Type Tree must be copied into the root directory ofWTXLib (the same location as the Customer.xsd file).

The Map Executables: CustomerDelimitedToXML.mmc andCustomerXMLToDelimited.mmc must be available to the WebSphereTransformation Extender data binding at runtime in a pre-defined location (/WTXfolder) and therefore must be present in either a library or a module.

1. Close any open Maps

2. Switch to Business Integration Perspective.

3. Switch to the Physical Resources Tab in the Business IntegrationPerspective.

4. Expand the CustomerMapProject and WTXLib projects as shown inFigure 46.Figure 46. Expanded Physical Resources View

ibm.com/developerWorks developerWorks®

Generating the WTX maps for use with WebSphere Process Server and WebSphere ESB© Copyright IBM Corporation 1994, 2008. All rights reserved. Page 29 of 33

Page 30: Using WebSphere Transformation Extender V8.2 with WebSphere …€¦ ·  · 2010-01-15Extender maps using the WebSphere WebSphere Transformation Extender V8.2 ... • WebSphere Transformation

5. Copy the CustomerDelimited.xsd file from the CustomerMapProjectand Paste it into WTXLib. (DO NOT DRAG AND DROP. YOU MUSTUSE CUT AND PASTE). The result should be as shown in Figure 47.Figure 47. Updated WTXLib

6. Create a new folder named WTX in the WTXLib library.

7. Copy the CustomerDelimitedToXML.mmc andCustomerXMLToDelimited.mmc files from the CustomerMapProjectand paste them into the WTX folder of the WTXLib. (DO NOT DRAGAND DROP. YOU MUST USE CUT AND PASTE). The result should beas shown in Figure 48.

developerWorks® ibm.com/developerWorks

Generating the WTX maps for use with WebSphere Process Server and WebSphere ESBPage 30 of 33 © Copyright IBM Corporation 1994, 2008. All rights reserved.

Page 31: Using WebSphere Transformation Extender V8.2 with WebSphere …€¦ ·  · 2010-01-15Extender maps using the WebSphere WebSphere Transformation Extender V8.2 ... • WebSphere Transformation

Figure 48. Completed WTXLib

WTXLib is now complete and ready for use at runtime.

Section 5. Conclusion

Congratulations, you have now generated two map executables that will perform thetransformation of data from the delimited format to an XML format and vice-versa.

You are now ready to create WebSphere Process Server and WebSphere ESBmodules that use the WebSphere Transformation Extender Data Binding to integrateWebSphere Process Server and WebSphere ESB with the application that uses thedelimited format. The author recommends that you now move on to Part 2 of thisseries, Using WebSphere Transformation Extender V8.2 with WebSphere ProcessServer and WebSphere ESB V6.1, Utilizing the WTX Data Binding with the Flat FileAdapter.

ibm.com/developerWorks developerWorks®

Generating the WTX maps for use with WebSphere Process Server and WebSphere ESB© Copyright IBM Corporation 1994, 2008. All rights reserved. Page 31 of 33

Page 32: Using WebSphere Transformation Extender V8.2 with WebSphere …€¦ ·  · 2010-01-15Extender maps using the WebSphere WebSphere Transformation Extender V8.2 ... • WebSphere Transformation

Downloads

Description Name Size Download method

WTXLabFiles download artifacts WTXLabFiles.zip 2KB HTTP

Information about download methods

developerWorks® ibm.com/developerWorks

Generating the WTX maps for use with WebSphere Process Server and WebSphere ESBPage 32 of 33 © Copyright IBM Corporation 1994, 2008. All rights reserved.

Page 33: Using WebSphere Transformation Extender V8.2 with WebSphere …€¦ ·  · 2010-01-15Extender maps using the WebSphere WebSphere Transformation Extender V8.2 ... • WebSphere Transformation

Resources

• Participate in the discussion forum for this content.

• WebSphere Transformation Extender home pageProvides technical resources for WebSphere Transformation Extender.

• WebSphere Transformation Extender Information CenterProvides product documentation for WebSphere Transformation Extender.

• WebSphere Transformation Extender articles on developerWorksFind the latest articles and tutorials for WebSphere Transformation Extender ondeveloperWorks.

• IBM WebSphere Application connectivity zone (formerly called WebSphereBusiness Integration zone)Get the technical resources you need to get started with WebSphere products.

• WebSphere Process Server product siteProvides product information for WebSphere Process Server.

• WebSphere Integration Developer product siteProvides product information for WebSphere Integration Developer.

• WebSphere Process Server Information CenterProvides product documentation for WebSphere Process Server.

• WebSphere Process Server articles on developerWorksFind the latest articles and tutorials for WebSphere Process Server ondeveloperWorks.

About the author

Dave MulleyDave Mulley is an IT Specialist and a member of the IBM Software Services forWebSphere Enablement team based in Raleigh, North Carolina. Dave is focused onthe WebSphere Business Integration family of products and has worked for IBMsince 1999. You can reach Dave at [email protected]

ibm.com/developerWorks developerWorks®

Generating the WTX maps for use with WebSphere Process Server and WebSphere ESB© Copyright IBM Corporation 1994, 2008. All rights reserved. Page 33 of 33