Feeds:
Posts
Comments

Posts Tagged ‘ESB toolkit 2 Creating an itinerary resolver extender’

The following post applies to BizTalk 2009 and 2010 versions.

  1. Create an itinerary resolver extender class. This is a C# helper class
    Sample code:

    using System;
    using System.ComponentModel;
    using Microsoft.Practices.Modeling.ExtensionProvider.Extension;
    using Microsoft.Practices.Modeling.ExtensionProvider.Metadata;
    using Microsoft.Practices.Services.ItineraryDsl;
    
    namespace myNs.myExtenderClass
    {
    [Serializable]
    [ObjectExtender(typeof(Resolver))]
    public class myExtenderClassResolver : ObjectExtender
    {
    public myExtenderClassResolver() { }
    
    [Category("Extender Settings"), Description("An XPATH on the incoming message."), DisplayName("Message ID XPATH"), ReadOnly(false)]
    //DefaultValue(" Specify a DEFAULT value here if you want")]
    public string MessageIdXPATH { get; set; }
    }
    
    //-----------------------------------------------
    [ResolverExtensionProvider, ExtensionProvider("F172878A-358A-4b55-9BBB-DAD795BD630B", "MessageXPath", "My Resolver Component Extension", typeof(ItineraryDslDomainModel))]
    public class StaticResolverExtensionProvider : ExtensionProviderBase
    {
    public StaticResolverExtensionProvider()
    : base(new Type[] { typeof(myExtenderClassResolver) })
    {
    }
    }
    
    }
    

    Note: The above code is primarily to display the resolver inside our Visual Studio UI when designing an itinerary. I decided to call it myComponent  (using an attribute tag).

    I’ve declared a single property in the above code called MessageIdXPATH. The implementation of this property should be done in a separate class that inherits from Microsoft.Practices.ESB.Resolver.IResolverProvider. The implementing class would extract value from this property:

    ResolverMgr.GetConfigValue(facts, false, "MessageIdXPATH");
    

    Note again: The primary objective of the above class was to display this property in the Visual Studio UI

  2. Build the above assembly in Visual Studio (extender class), GAC it and place it under
    Location:  …\{ Microsoft BizTalk ESB Toolkit 2.x}\Tools\Itinerary Designer\Lib\

Verification

  1. In the itinerary designer, drag and drop the “Itinerary Service” component to the toolbox
  2. Once a resolver is created, select the created component  (Resolver Implementation) using properties window
  3. After selecting the component (MessageXPath), a property is listed in the designer (called MessageIdXPATH)

Happy designing 🙂

Advertisements

Read Full Post »