.comment-link {margin-left:.6em;}

Ben Cops

Monday, June 21, 2004

Microsoft.BizTalk.CrossReferencing

The Microsoft.BizTalk.CrossReferencing.CrossReferencing class is available to use from expressions, and in the database functoids - it allows you to crossreference IDs and values between different systems. For example, you might be dealing with the same customer on 3 different systems - they all have their own ID for the customer and every time you need to work out what the CustomerID is for ExternalSystemX, you can use the CrossReferencing class and functoids to look it up for you.
The SDK documentation basically ends there (cheers) - but there's a bit more online now. The cross referencing database functoids use data from tables stored in the BizTalkMgmtDb SQL Server database, and you need to import your seed data (what systems there are, what IDs you want to track, etc) using a little command line job in the BTS2004 install directory (BTSXRefImport.exe). Otherwise you'll get errors like:
Unhandled Exception: Microsoft.BizTalk.CrossReferencing.RuntimeException: IDXRef <CustomerID> or AppInstance <OldSystem> is not registered.

The data model is modelled as
Applications->Application Instances->IDXrefs (the type of ID you want to persist - in this case the type is "CustomerID"). To set the CrossReferencing database up to use this you simply need to create a number of XML files to store this seed data, and then run the tool on it. Then you can write code like:
CrossReferencing.SetCommonID("CustomerID", "OldSystem_Production", "23", "5");
MessageBox.Show(CrossReferencing.GetAppID("CustomerID", "OldSystem_Production", "5"));


Should you so desire.
There doesn't seem to be any particularly useful way of removing or resetting this seed data (not that I can find anyway) - but the tables are simply all the tables in BizTalkMgmtDb that are prefixed xref_*

I'm not sure any of that was quicker than writing the logic one'self, but its nice having it in the functoids.
There appears to be a hotfix for the bit of the API they forgot to write:
FIX: You cannot remove an application ID after you create it by using a database functoid in BizTalk Server 2004
:)

29 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home