BizTalk Cross References

What is reference data?

 

Typically by reference data we mean an attribute of an object within a system that is restricted to a specific list of values.  In integration scenarios when you are passing a message from one system to another these lists of reference data are different between the systems.

This means if you have a product type id or value from System A there will usually need to be some kind of mapping required to translate the value or id to an equivalent value that System B will understand.
The below diagram illustrates this.

 

 

BizTalk Pattern

 

In the case of BizTalk, we at least 3 system :

  • System A
  • System B
  • BizTalk

Indeed, if you use a EAI pattern, with half-flow, you can have one Input Half Flow and more than one Output Half Flow. So, in this case, you must translate the property Value or Id in a Reference Value or Id.

If we consider the following diagram :

 

image

 

There is a System A which send Data to BizTalk and  the BizTalk send the data (after Mapping and Orchestrations) to System B and System C.

Now,there is few possibilities :

  • All the system have the same product value or Id, we don’t need to use reference data.
  • System B and System C have the same product value or Id, we need to use a mapping data between System A and BizTalk.
  • All the system have different product value or Id, so we need to translate the value in a mapping in  each half flow.

To do that, we have few functoid in the DataBase functoid group :

clip_image001 Get Application ID

Retrieves an identifier for an application object.

clip_image002 Get Application Value

Retrieves an application value.

clip_image003 Get Common ID

Retrieves an identifier for a common object.

clip_image004 Get Common Value

Retrieves a common value.

 

Where Application represent BizTalk. Indeed, we are in a BizTalk Centric System, and a common value is the value of a System X and the Application Value (or Id) is when the Data is inside BizTalk (the Reference System)

 

These functoids get data imported in the following BizTalk Management Table :

 

In our case, if we deal with the following product value

System A Product_A
System B Product_B
System C Product_C
   

 

In the Input Half-flow, we need to translate the value of the System A to the reference value. So we need to use the Get Application Value functoid. In this functoid, we need to use this parameter :

Parameter 1: A string of up to 50 characters that identifies the type of the object being referenced.(this parameter represent the FIELD of the message )

Parameter 2: A string of up to 50 characters that identifies the type of the application. (this represent the System A)

Parameter 3: A string of up to 50 characters that contains the common value. (this represent the System value that we need to translate)

 

In the Output Half Flow , we need to translate the value in the BizTalk Reference Table into the Target system. So we need to use the Get Common Value Functoid. In this functoid, we use this parameter :

Parameter 1: A string of up to 50 characters that identifies the type of the object being referenced. (this parameter represent the FIELD of the message )

Parameter 2: A string of up to 50 characters that identifies the type of the application. (this represent the System B or System C )

Parameter 3: A string of up to 50 characters that contains the application value. (this represent the BizTalk value that we need to translate)

 

To Insert the reference data into the Xref Table, a tool is given with BizTalk : BTSXRefImport.exe (located in the %Program Files%/Microsoft BizTalk Server 200x/), this tools use a setup file that reference other xml file to import the Data. In our sample, we will import data to into the following table : , to use the two functoid Get Application Value and Get Common Value.

 

So the setup file look like this :

<?xml version="1.0" encoding="UTF-8"?>
<Setup-Files>
    <App_Type_file>%Folder%ListOfAppType.xml</App_Type_file>
    <ValueXRef_file>%Folder%ListOfValueXRef.xml</ValueXRef_file>
    <ValueXRef_Data_file>%Folder%ListOfValueXRef_Data.xml</ValueXRef_Data_file>
</Setup-Files>

 

In the ListofAppType.xml, we define all the System outside BizTalk :

<?xml version="1.0" encoding="UTF-8"?>
<listOfAppType>
    <appType>
        <name>System A</name>
    </appType>
    <appType>
        <name>System B</name>
    </appType>
    <appType>
        <name>System C</name>
    </appType>
</listOfAppType>

 

In the ListOfValueXref, we define all the field we need to translate :

<?xml version = "1.0" encoding = "UTF-8"?>
<listOfValueXRef>
    <valueXRef>
        <name>Country</name>
    </valueXRef>
    <valueXRef>
        <name>Credit Term</name>
    </valueXRef>
    <valueXRef>
        <name>Order Type</name>
    </valueXRef>
</listOfValueXRef>

 

In the listOfValueXrefData, we define the translation between an appValue and a commonValue for the couple (Field,Application)

<?xml version="1.0" encoding="UTF-8"?>
<listOfValueXRefData>
    <valueXRef name="Credit Term">
        <appType name="System A">
            <appValue commonValue="Credit Term 1">001</appValue>
            <appValue commonValue="Credit Term 2">002</appValue>
            <appValue commonValue="Credit Term 3">003</appValue>
            <appValue commonValue="Credit Term 4">004</appValue>
        </appType>
    </valueXRef>
</listOfValueXRefData>

 

If we are in the System A, the value 001 of the field Credit Term is translate to Credit Term with the GetCommonValue.

 

Tips to knows :

  • The functoids functoid hit the database for each translation, there is no cache. So we can imagine a solution with a custom class and a custom functoid to enable cache.
  • The tools BTSXRefImport.exe work in Cancel and Replace Data.

 

Links :

http://geekswithblogs.net/michaelstephenson/archive/2006/12/24/101995.aspx

http://msdn.microsoft.com/en-us/library/aa578674(BTS.20).aspx

This entry was posted in BizTalk. Bookmark the permalink.

One Response to BizTalk Cross References

  1. Pingback: Biztalk reference | Mikidogs

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s