BizTalk Mapper and Altova MapForce Compared

BizTalk Mapper and Altova MapForce are both tools used to data from one schema to another. A schema internally is treated as XML, but may represent a flat file, CSV, a SQL table to stored proc, or a web service request/response message. Typically the job of a B2B developer is to map data from one format to the other. In this blog, I compare mapping from schema “Flight” to schema “FlightNew” using both tools.

BizTalk

Below is a sample BizTalk Map.

BizTalk Example Map
BizTalk Example Map

BizTalk has various functions called Functoids. Internally, these are implemented in C# embedded in the XSLT code. There is a red concatenate Functoid in the sample above, and two Scripting Component Functoids. A Scripting Component allows you to type or paste-in your own custom C# code. So this is how I implemented the difference in the two dates.

BizTalk_Script_Functoid_CSharp

You can right-click on the map properties in the Solution Explorer, and set the desired XML input file. Then right-click the map name in Solution Explorer, and click “Test Map”. After the map runs, you will see some text in the Output window. You can CNTL-CLICK on the output file, then you will then see the results below.

BizTalk - Results of "Test Map"
BizTalk – Results of “Test Map”

Altova MapForce

Altova MapForce - Full Screen
Altova MapForce – Full Screen

MapForce has a “datetime-diff” function, but the output has to go to a field defined with a type of xs:duration. I had actually never heard of this data type before. You can see the “concat” function in XSLT is essentially identical to the one in BizTalk.

Altova MapForce - Zoom In on Mapping
Altova MapForce – Zoom In on Mapping

Click the “Output” tab under the map to view the conversion of the data to the new schema format:

Altova MapForce - Sample Output
Altova MapForce – Sample Output

 

However, some functions are only supported in C# and Java. When switching to XSLT, I found the function below to be unavailable. You can see the striped lines appear in the function below.

Altova_MapForce_NonXSLT_Function

I didn’t have time to try to reimplement that function in XSLT.  So below is the same map without being able to compute the difference between ScheduledDateTIme and ActualDateTime.

When in XSLT mode, and XSLT tab appears below the mapper. Below is the view of the XSLT code generated from the visual tool.

One of the advantages of MapForce is that it can build XSLT, and has a two-way editor. You can edit the visual mapper, or edit the XSLT code directly, and the other automatically syncs.

Altova MapForce XSLT Tab
Altova MapForce XSLT Tab

Altova can also generate Java, C# or C++ code to perform the transformation.  You can take that code, and call it from your application.  MapForce has EDI functionality built in, so you can map for example 850 Purchase Orders into XML data.

One of the advantages of MapForce is that it can build XSLT, and has a two-way editor. You can edit the visual mapper, or edit the XSLT code directly, and the other automatically syncs.

By the way, BizTalk does support XSLT, but once you switch to what they call “Custom XSLT”, you can no longer use the visual “GUI” editor.

So in this overview, we see two ways to map data using two different but similar tools.  We saw that the scripting functions can be quite different in the two products.

Leave a Reply

Recent Posts

Archives

Categories

Meta

All Rights Reserved Theme by 404 THEME.