In an Itinerary Service you can use a Resolver for dynamically resolving endpoint information and BizTalk Maps. Most of the times when you create a custom Itinerary Service you want to transform or send your message but there are also cases that you want to do something else like logging or validating your message. In that case Resolvers are not useful because the properties and data that they return contain endpoint information and maps. The Itinerary Designer in Visual Studio fortunately allows you to create custom extenders for Itinerary Service model elements that can be used to add properties to the property bag for use by Orchestration-based Itinerary Services. Through this you no longer need to use a Resolver to feed your Orchestration with dynamic data because you can set the properties directly on the Itinerary Service.
01.
[Serializable]
02.
public
class
Message
03.
{
04.
private
string
_error =
.Empty;
05.
06.
Error
07.
08.
get
return
_error; }
09.
}
10.
11.
12.
void
SetErrorMessage(
message)
13.
14.
_error = message;
15.
16.
ItineraryServiceDictionary
Dictionary<
,
> resolverDictionary;
ItineraryServiceDictionary(Dictionary<
> dictionary)
if
(dictionary ==
null
)
throw
new
ArgumentNullException(
"dictionary"
);
this
.resolverDictionary = dictionary;
Item(
key)
17.
str =
18.
key = key.Trim();
19.
(
.resolverDictionary.ContainsKey(key))
20.
21.
.resolverDictionary[key];
22.
23.
str;
24.
25.
26.
> BaseDictionary
27.
28.
29.
30.
.resolverDictionary;
31.
32.
33.
[ObjectExtender(
typeof
(ItineraryService))]
PolicyOrchestrationExtender : ItineraryServiceExtenderBase, IOrchestrationItineraryServiceExtender
[Editor(
(BiztalkOrchestrationServiceNameEditor),
(UITypeEditor))]
[TypeConverter(
(TypeConverter))]
[EditorOutputProperty(BiztalkOrchestrationServiceNameEditor.ServiceId,
"ServiceId"
)]
override
ServiceName {
;
set
; }
ServiceType
"Orchestration"
[Category(PolicyOrchestrationExtensionProvider.ExtensionProviderPropertyCategory),
Description(
"Specifies the Business Rule Policy."
),
DisplayName(
"Policy"
ReadOnly(
false
Browsable(
true
[XmlElement]
[StringLengthValidator(1, RangeBoundaryType.Inclusive, 0, RangeBoundaryType.Ignore, MessageTemplate =
"The 'Policy' property should not be null or empty."
[PersistInPropertyBag]
//NOTE: This property will be persisted in the service property bag
Policy {
"Specifies the DocumentType."
"DocumentType"
"The 'DocumentType' property should not be null or empty."
DocumentType {
34.
The Orchestration Extender properties are used in a Validation Orchestration Service which validates the message by using the Business Rule Engine.
<
itineraryService
type
=
"ESB.ItineraryServices.ValidationService, itHero.ItineraryServices.Orchestrations, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ea5135d336848c97"
name
"ValidationService"
stage
"None"
scope
id
"2000"
/>
The Validation Orchestration uses the Business Rule Engine to validate the message. With a custom .NET class is the error set. The following steps describe how to add a custom .NET Class to the Business Rule Composer and how to create a Business Rule Policy to validate the message.
Create an Itinerary that uses the Business Rule Policy Orchestration Extender and the Validation Service to validate the message.
Once the Orchestration Service is deployed to BizTalk and the custom component .dll file is placed in the GAC, the Itinerary is ready to be tested.
You can download the sample tool with the source code here: Creating a Custom Extender for an Orchestration-Based Itinerary Service sample
Read suggested related topics:
Another important place to find a huge amount of BizTalk related articles is the TechNet Wiki itself. The best entry point is BizTalk Server Resources on the TechNet Wiki.