1. Problem
Within a map, you wish to
statically cross-reference state values between two or more systems, and
the value cross-references have already been loaded into the
cross-reference tables. For example, a source system publishes an Order with a status of 1:Open, and you want to cross reference and translate the static state value to the static value in a destination system of OP.
2. Solution
To cross-reference the static values within a map, take the following steps:
Click the Database Functoids tab in the Toolbox.
Drag the Get Common Value functoid to the map surface.
Open the Input Parameters dialog box for the Get Common Value functoid.
Add
a constant parameter, and set the value to the static value type you
wish to cross-reference. For instance, you may set the value to
something like Order.Status.
Add
a second constant parameter to the Get Common Value functoid, and set
the value to the source system application type. For instance, you may
set the value to something like Siebel.
Connect the state value source node you wish to cross-reference from the source schema to the Get Common Value functoid.
Drag
the Get Application Value functoid from the Database Functoids tab to
the map surface, and place it to the right of the Get Common Value
functoid.
Open the Input Parameters dialog box for the Get Application Value functoid.
Add
a constant parameter, and set the value to the static value type you
wish to cross-reference. For instance, you may set the value to
something like Order.Status.
Add
a second constant parameter to the Get Common Value functoid, and set
the value to the destination system application type. For instance, you
may set the value to something like Oracle.
Connect the Get Common Value functoid to the Get Application Value functoid.
Connect the functoid to the unique destination state value node.
3. How It Works
Identifier and value cross-referencing are similar in concept, with the following differences:
Value
cross-referencing is commonly between enumeration fields. Identifier
cross-referencing is commonly between entity unique identifiers.
Value cross-referencing occurs between system types. Identifier cross-referencing occurs between instances of system types.
Identifier
cross-references may be set at runtime. Value cross-references are
static and may be loaded only through the import tool or direct table
manipulation.
The basic steps for converting from one system to another are as follows:
Using
the source application type, source application static value, and
source entity value type, retrieve the common value by calling the Get
Common Value functoid.
NOTE
The common value is generally not stored in any system. It is a value used to associate multiple values.
Using
the common static value, destination system type, and destination
entity value type, retrieve the destination static value by calling the
Get Application Value functoid.
This recipe has focused on
accessing value cross-referencing functionality through BizTalk
functoids, but an API is also available. The cross-referencing class may
be found in the Microsoft.Biztalk.CrossRreferencing.dll, within the namespace Microsoft.BizTalk.CrossReferencing. This class has several members that facilitate storing and retrieving value cross-referencing relationships, as listed in Table 1.
Table 1. Value Cross-Referencing API
Member | Description |
---|
GetCommonValue | With
an application type, entity/node value type, and application value,
this member retrieves a common value. If a cross-reference does not
exist, a blank will be returned. If the application type or entity/node
value type does not exist, an exception will be thrown. |
GetAppValue | With
a common value, application type, and entity/node type, this retrieves
the application value. If a cross-reference does not exist, a blank will
be returned. If the application type or entity/node value type does not
exist, an exception will be thrown |