Archive

Posts Tagged ‘Biztalk Functoid Wizard’

Biztalk Custom Functoid Wizard for Biztalk 2004 & 2006

June 29, 2009 LeandroDG 3 comments

First, this release got delayed about 3 years!. But, it still works fine and I’ve used it in many Biztalk Project over the last years, so I think it may be of use for every other BTS developer out there.

The idea behind this project is to be able to build custom Biztalk Functoids through a wizard. When this was built, there was not much information on the web about developing custom functoids, so it was a little hard to work on it. It’s based on Boudewijn van der Zwan and Scott Woodgate‘s Biztalk Adapter Wizard. I’ve also based this development in Martijn Hoogendoorn‘s Biztalk Pipeline Component Wizard. These are the original releases for this components: Adapter Wizard, Pipeline Wizard.

Basically a custom functoid is very similar to a Scripting Functoid with the same code copied once and again. The idea of developing a custom functoid instead of a Scripting Functoid is to avoid code repetition and to be able to modify it in every map that uses it simultaneously. This concept is known as DRY (Don’t repeat yourself).

I’ve built an original version for 2004 for an enormous project which required around 50 custom functoids to be built, of course building them by hand would be very time consuming. Adrian Lopez helped me adapt this version to Biztalk Server 2006, special thanks to him for the help!.

I’m posting both versions here, for Biztalk 2004 (and Visual Studio .NET 2003) and Biztalk 2006 (and Visual Studio .NET 2005).

Installation and usage is quite simple but I’ll show the usage step by step in a simple “Hello world” functoid sample.

  1. Start up Visual Studio, go to File, New Project, and select Biztalk Projects:
    Biztalk Functoid Wizard Project type selection

    Biztalk Functoid Wizard Project type selection

  2. Splash screen

    Biztalk Functoid Wizard Initial wizard splash

    Biztalk Functoid Wizard Initial wizard splash

  3. Now you must select some general properties: class name, namespace, assembly name and assembly key file (.snk), which can be generated by clicking on New or selected by clicking on the browse button. You must select either a key file or a key name (the last one if you’ll be using the Crypto Service Provider).

    Biztalk Functoid Wizard General project properties

    Biztalk Functoid Wizard General project properties

  4. In this screen you must choose the functoid id (this is a unique id that cannot be repeated among functoids, so be careful not to repeat yourself), name, tooltip and description.

    Biztalk Functoid Wizard Functoid properties

    Biztalk Functoid Wizard Functoid properties 1/2

  5. You can choose the category where the functoid will be shown and a default exception message. Also you can select the icon for the functoid (by double clicking on the predefined icon), and select VB.NET or C# as the implementation languages.

    Biztalk Functoid Wizard Functoid properties 2/2

    Biztalk Functoid Wizard Functoid properties 2/2

  6. Then it’s time to select the incoming parameters for the functoid, the return type and the allowed input and output connections for the functoid. Also you can re-order the parameters and define minimum and maximum amount of parameters.

    Biztalk Functoid Wizard Functoid parameters & connection types

    Biztalk Functoid Wizard Functoid parameters & connection types

  7. We are ready, functoid definition is finished.

    Biztalk Functoid Wizard Completion splash

    Biztalk Functoid Wizard Completion splash

  8. Now, into some code. A functoid is nothing more than a function that can be used inside a map. We defined the interface with the wizard, but we need to edit the source code for the implementation. The wizard will have autogenerated the following code:
    public System.String Execute()
    {
    	ResourceManager resmgr = new ResourceManager(ResourceName, Assembly.GetExecutingAssembly());
    	try
    	{
    		// TODO: Implement Functoid Logic
    	}
    	catch (Exception e)
    	{
    		throw new Exception(resmgr.GetString("FunctoidException"), e);
    	}
    }
  9. We add the basic “Hello world” implementation:
    public System.String Execute()
    {
    	ResourceManager resmgr = new ResourceManager(ResourceName, Assembly.GetExecutingAssembly());
    	try
    	{
    		return "Hello world!";
    	}
    	catch (Exception e)
    	{
    		throw new Exception(resmgr.GetString("FunctoidException"), e);
    	}
    }
  10. Now we just build the whole solution, it will automatically generate our file Logue.Biztalk.Functoids.dll inside of Microsoft BizTalk Server 2006Developer ToolsMapper Extensions in the program files folder. We open a map inside of Visual Studio and right-click on the functoids toolbox, and we select “Choose Items”. The following screen appears:

    Functoid toolbox item selection

    Functoid toolbox item selection

  11. We browse for the file. As explained before, it will be inside of Microsoft BizTalk Server 2006Developer ToolsMapper Extensions in the program files folder.

    Browsing for custom functoid assembly

    Browsing for custom functoid assembly

  12. Now the functoid appears in the item selection box, so we check it and click on Ok.

    Our functoid in the toolbox item selection

    Our functoid in the toolbox item selection

  13. Now it appears in the toolbox:

    Functoid toolbox with our functoid

    Functoid toolbox with our functoid

  14. And now we drag&drop it, link it, and we can test the map!

    Our functoid used in a map

    Our functoid used in a map

I hope you find it useful! Please report any bugs or information you think it would be useful to share.

Downloads:

Biztalk Functoid Wizard 2006 Source Code (128)
Biztalk Functoid Wizard 2006 Installer (144)
Biztalk Functoid Wizard 2004 Source Code (90)

Update (2010/01/24): I’ve fixed the download module after moving to a new hosting provider, they are now working again.

VN:F [1.9.11_1134]
Rating: 5.0/5 (3 votes cast)