Creating Compiling and Testing the

Now that we are familiar with the basics of what maps are and why you would use them, let's create a very simple one, compile it, and test it. This exercise will allow you to get the feel of the GUI that the BizTalk Mapper incorporates into its functionality, as well as gain some experience working within the tool itself. After completing the exercise, we will go through all the menus and items of the user interface to briefly discuss where things are and those items we did not use in the actual exercise.

Creating and Compiling the Map

Let's get started creating and compiling the map:

1. We need to have the BizTalk Mapper open. It should be in the same state as we left off from the last exercise. Both specifications should be loaded, and the Mapper should look similar to Figure 5.12.

2. We'll begin with basic mapping. Let's map October to October. Left-click October and hold the button down. Drag from the source (left side) to the destination (right side). A set of sniper crosshairs should appear in your Mapper utility. Drag the crosshairs all the way to the right side of the October field and release the button. It will connect, and you will have a mapping from one field to another.That's it! You created a mapping.

3. Now let's quickly learn how to "undo" a mapping.You can right-click the line that goes across the BizTalk Mapper to produce a Properties menu, but it is all relative to where you are in the Mapper. In other words, go to the left side of the Source Specification pane, and right-click the mapping line.You will see an option to Replace the specification, which we do not want to do (although this is how you can replace the specification with another if you need to).

4. Go to the Middle Grid pane and right-click the map line. Now you can see an option to delete the mapping. Select Delete and watch as the mapping line disappears. Now, repeat step 2 to recreate your mapping. In the menu option where you could delete the mapping is an option to "unselect."This is not to "unselect the mapping," but to unselect the line you just clicked on. Left-clicking on the line once selects it and turns it blue.

5. You should now have October mapped to October, so let's map a few more items. Map August to August. Map the Source specification's December to the Destination specification's January. Map the Source specification's January to the Destination specification's December.You should have a mapping system that look like Figure 5.13. Now, we have four simple mappings.

Figure 5.13 Compiling a BizTalk 2000 Map and Viewing Output

Figure 5.13 Compiling a BizTalk 2000 Map and Viewing Output

6. Let's finish this map by compiling it. Go to the Tools menu and select to Compile map. After you compile the code, look at the Output tab in Figure 5.13.You can see what we called XSL (Extensible Stylesheet Language), which we will cover next. With the compiling finished, let's move on to the testing and saving of the map we just made.

Extensible Stylesheet Language

We mentioned XSL previously, but it warrants a good explanation for you to fully understand what the BizTalk Mapper is doing. The Extensible Stylesheet Language (XSL) is just like a cascading stylesheet (CSS) for HTML documents. The XSL language is used for expressing stylesheets with the underlying power to perform transformations. XSL Transformation (XSLT) is a subset of XSL that allows for transformation from one form to another. This is what the BizTalk Mapper was designed to do, transform one form to another using XML. Now when you look at the stylesheet in the Output tab shown in Figure 5.13, it should make more sense as to what the output really is.

Testing and Saving Your Map

Follow these steps to test and save the map:

1. To test the map, go to the Tools | Test Map option in the Menu Tools menu and select to test it.

2. When you test it, you will see the test results in the Output tab. Figure 5.14 shows that our mappings equal out and are correct. Any errors that occur pop up automatically in the Warnings tab, which will give you an idea on what the problem might be to guide you in the right direction to fix it. Now that it tests clean, let's save it!

3. To save the map, go to the File menu and open File | Save As, which will open the Save Map Source As dialog box.

4. Enter a name for the map you just created. Call it MYSAVEDMAP.

Figure 5.14 Testing a BizTalk 2000 Map and Viewing Output

Figure 5.14 Testing a BizTalk 2000 Map and Viewing Output

lH>pIt Jl I li »oaita ih-i.-utr^i1 rf.-iun_L' } * laq _ I - IH--. ■ u n_ a' .-v

5. The map automatically compiles when you save it, so you don't need to specifically call on the BizTalk Mapper; it is set to do it by default.

6. Two important topics to mention are UTF-8 and Unicode encoding. If you select to save this as ASCII readable, choose UTF-8, which is the default. However, if you need to save the map as double-byte character sets, then you need to drop down the menu in the Save As dialog box and select Unicode.

7. If you want to compile it manually before saving, simply go to the Tools menu and select to Compile Map as we did in the previous exercise.

You have just created a map, tested it, compiled it, and saved it for future use. In the next section, we will look at altering the map using functoids, and in the last section, we will open and map two predefined specifications.

Was this article helpful?

0 0

Post a comment