Tuesday, 12 November 2013

Biztalk Cross Reference

Reference Data:

Reference data means, it is an object within a system that is restricted to 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. (Where a particular field of the source maps to another field in destination. But their values aren’t so agreeable)
If we use an EAI (Enterprise Application Integration) pattern, you can have one input and more than one output flow. So, in this case, you must translate the property Value or Id in a Reference Value or Id.
In this case consider the example diagram:

Example Scenario:

We have a field called status in Application1 which field named mapped to status in Application2 and status in Application3. But the possible list of values are different.
Field
Application 1
Application 2
Application 3
Status
Open
Entered
Started
Status
Closed
Done
Finished

How to solve this issue?

There are many possible ways.
Write an inline script / xslt in a Scripting Functoid

  1.        Use an External dll that takes an input and returns an equivalent output
  2.        Use of BizTalk Server Cross Reference Functoids.
  3.        Custom Functoids and Lots of more options….
Explained here for pros and cons of each solution.
This article provide solution by using Cross Reference Functiods. The cross referencing database functoids use data from tables stored in the BizTalkMgmtDb SQL Server database. The functoids available and XML files that represents the reference data listed below.

Functiods available in Biz talk:

 Get Application ID
Retrieves an identifier for an application object.
 Get Application Value
Retrieves an application value.
 Get Common ID
Retrieves an identifier for a common object.
 Get Common Value
Retrieves a common value.
All these functiods are listed under Database functiods group.

XML files that represents the cross reference data:

SetUp-Files
This will have the path to all other files
listOfAppType
This will have the list of applications. In our case it is “Application1″ ,“Application2″ and “Application3”
listOfAppInstance
For each Application created, an instance should be created
listOfIDXRef
This XML file will hold the IDs for which we create Data. In our case it is the “Status”
listOfIDXRefData
This file will hold the data for Common ID, “Application1″ data “Application2″ Data, and “Application3” data
listOfValueXRef
This XML file will hold the IDs for which we create Data. In our case it is the “type”
listOfValueXRefData
This file will hold the data for Common value, “Application1″ data “Application2″ Data, and “Application3” data
listOfMessageDef
This XML file hold the information related to message codes
listOfMessageText
This XML file hold the information related to message binding to the message code
You can find in MSDN for more information about document structure and how to import data for Cross referencing functoids.
Note: we can have any name for file but the format of data should be as per documentation.

Solution Approach:


  1.        Create a XML files that represents the cross reference data.
  2.        These XML files (data) are imported to a set of Tables inside BizTalk Management Database (BizTalkMgmtDb) using BizTalk Server Cross Reference Import tool (btsxrefimport.exe)

Cross Reference Types:

There are 2 types of Cross Reference – 

No comments:

Post a Comment