Transforming Data between Documents

To enable the use of the map by the BizTalk Messaging Engine, the map must be compiled into an Internet standard document called an Extensible Stylesheet Language Transformations (XSLT) file. XSLT is a language for transforming Extensible Markup Language (XML) documents from one XML schema into another. When the BizTalk Messaging Engine receives a document, it parses it into its XML representation using the BizTalk Editor specification that's been created for it. It then selects the channel(s) to execute and applies the BizTalk XSLT maps to the XML representation of the inbound document if required. The resulting outbound document is then serialized into its native format using an associated BizTalk serializer. Figure 5.1 depicts the general mapping process.

Figure 5.1. The general mapping process.


To facilitate the transformation of documents, you must first create an XML (XDR) representation of both the inbound and outbound documents using the BizTalk Editor. After you've created the specifications, you can then use the BizTalk Mapper to define the transformations between them. To accomplish this, you create a BizTalk map using the BizTalk Mapper, as shown in Figure 5.2.

Figure 5.2. A completed map in the BizTalk Mapper.


Notice in the leftmost pane a document specification tree similar to what's displayed in the BizTalk Editor. That pane represents the source, or input, document. In the rightmost pane is a tree representing the destination, or output, document (right-justified and reverse-indented).

Strictly speaking, the left pane does not represent the actual input document structure but rather the XML structure of the source interchange after parsing of the input document according to its BizTalk specification. Similarly, the right pane represents the destination interchange before it is converted into the actual output document. Therefore, the BizTalk Mapper need not consider at all whether the input and output documents are XML, EDIFACT, ANSI X12, flat-delimited, or flat-positional files. The BizTalk Mapper always transforms data between well-formed XML interchange documents—vastly simplifying your task of constructing the mapping between documents.

The pane in the middle, the mapping grid, allows you to construct the mapping of the input document to the output document. Data can be copied from input fields to output fields and can also be routed through transformation objects that perform string, arithmetic, and many other functions on the input data to produce the fields needed for the output document. Because the mapping can become complex for complex documents, multiple pages of mapping can be created (as separate window tabs) to divide the map into more understandable individual pieces. Also note that the mapping is one way only, from left to right. If a reverse map is needed from the output format to the input format, a separate map must be created with the input and output exchanging positions.

The bottom pane (full width of the window) has several tabs for viewing document properties, entering sample field data to test the map, and viewing outputs and warnings from Mapper testing and compilation. We will cover each of those tabs at a natural point as we proceed.

To illustrate the capabilities of the BizTalk Mapper, we will use a scenario of student record interchange between applications used by a University Extension department. We will show how the information contained in class rosters, student grade reports, and other documents can be translated from one format to another using BizTalk specifications and maps.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset