• No results found

Chapter 3. Enabling existing applications

3.3 Transformations

3.3.2 Creating a type tree with Type Designer

Mapping artifacts: Completed mapping artifacts are provided in the additional materials

that are associated to this paper. For details, see Appendix B, “Additional material” on page 183.

More information: You can find information about WebSphere Transformation Extender

on the Web at the following address:

of data. The

structure

of the data refers to its composition including repeating substructures and nested groupings. The

semantics

of the data refer to the meaning of the data including rules for data values, relationships among parts of a large data object, and error detection and recovery.

For more information about Type Designer, refer to the Type Designer document at the following address:

ftp://ftp.software.ibm.com/software/websphere/integration/wdatastagetx/1003.pdf

To create a type tree:

1. Create a directory called FilesWTX and copy the files shown in Table 3-1 into this directory.

Table 3-1 Files used for creating the type trees

2. Open the Type Designer application. Select Start→ Programs → IBM WebSphere

Transformation Extender 8.1→ Design Studio → Type Designer.

3. From the toolbar, select Tree→ Import.

4. In the Import from window of the Importer Wizard (Figure 3-5), select XML Schema and click Next.

Figure 3-5 Importer Wizard

File Function

CCOUT4K.cpy Host Response copybook

CCINP.cpy Host request copybook

5. In the next window, click the Browse button to navigate to the schema file,

SOAAssureService.xsd, in the C:\FilesWTX\ directory. Select SOAAssureService.xsd.

Click Next.

6. In the next window, National Language uses the default of Western. Click Next.

7. In the XML Schema window (Figure 3-6), for File Name, change the type-tree destination file to C:\WTXWork\SOAAssureService.mtt and click Next.

Figure 3-6 Type tree destination file

Note: The SOAAssureService.xsd file refers to the DataType.xsd and PayloadType.xsd

8. The importer builds the type tree. Click Finish (Figure 3-7).

9. When you see the message that prompts you about opening the newly generated type tree, click Yes. Figure 3-8 shows the new type tree.

Figure 3-8 SOAAssureService.mtt

10.Create the request COBOL type tree file. From the toolbar, select Tree→ Import. 11.Click Next.

12.In the Importer Wizard window, select COBOL Copy Book and click Next.

13.In the next window, click the Browse button, navigate to the C:\FilesWTX\ directory, and select the COBOL file CCINP.cpy. Click Next.

14.In the Importer Wizard-COBOL Copybook window, you see a check box indicating that you can generate a type tree for a CICS type tree. Since we are not generating a tree for CICS, do not select the check box.

15.In the COBOL Copybook window (Figure 3-9), for File Name, change the type tree destination to C:\WTXWork\CCINP.mtt. Click Next.

Figure 3-9 COBOL type tree destination file

17.Click Finish. As a result of the steps, the CCINP.mtt and SOAAssureService.mtt files (shown in Figure 3-10) should be in the C:\WTXWork directory. We use these files for the request mapping process in 3.3.3, “Mapping an input type tree to an output type tree by using Map Designer” on page 65.

Figure 3-10 XSD and COBOL message definition

18.Create the response COBOL type tree file. From the toolbar, select Tree→ Import. 19.Click Next.

20.In the Importer Wizard window that opens, select COBOL Copy Book and click Next. 21.In the next window, click the Browse button, navigate to the COBOL file in the

C:\FilesWTX directory, and select CCOUT4K.cpy. Then click Next.

22.In the Importer Wizard-COBOL Copybook window that opens, do not select the check box for generating a type tree for a CICS type tree, because we do not generate a tree for CICS.

From the character-set list, select EBCDIC, and from the byte order list, select BIG

ENDIAN. Click Next.

23.In the next window. Change the Type tree definition to C:\WTXWork\CCOUT4K.mtt. Click

25.One of properties of the elements of the type tree is to specify the characters that will be used to indicate no data. For example, the default is blanks for the string element type. Because we are not modifying the defaults, we can make DataPower run time more efficient by not using this property altogether. To clear this property:

a. From the type tree, select CopyBook→ Field. b. Right-click and select Properties.

c. Select Item Subclass→ None → Special value. In the Value field, erase any characters.

d. Select Item Subclass→ None → Required on input. In the Value field, choose No. e. Right-click Item Subclass→ None → Special value. Then select Propagate. As a result of these steps, you should have a CCOUT4K.mtt type tree created in the WTXWork directory. We use the CCOUT4K.mtt and SOAAssureService.mtt files for the response mapping process in 3.3.3, “Mapping an input type tree to an output type tree by using Map Designer” on page 65.

26.Exit the Type Tree tool.