Thursday, November 27, 2008

Hi all

A new functoid has been added to the collection of functoids that an be downloaded at

The functoid simply takes one parameter, which is used as a key against BizTalks app.config (The BTSNTSvc.exe.config file in BizTalks installation folder) to read an application setting from the appSettings group.

So given a .config file like this:

<add key="eliasen" value="eliasenValue" />

and the parameter "eliasen" to the functoid, it will return "eliasenValue". If the key cannot be found, an empty string is returned.

And the documentation has also been updated - look at


Thursday, November 27, 2008 9:20:03 PM (Romance Standard Time, UTC+01:00)  #    Comments [0]  | 
Monday, November 24, 2008

Hi all

I have added a new functoid to my functoid library.

This functoid will take a string, that is separated by some character as input and split it up into the substrings it is, given the separator. It will then return the substring given by a third parameter.

So for instance, given these three inputs:

  1. Jan,Eliasen,BizTalk
  2. ,
  3. 1

You would get "Eliasen" as output.

You can download my functoid library at and here you can also find updated documentation describing this new functoid.


Monday, November 24, 2008 2:06:33 AM (Romance Standard Time, UTC+01:00)  #    Comments [0]  | 
Saturday, November 22, 2008

Hi all

As you have probably read in my previous posts this month, I have started creating a functoid library, which is freely downloadable if you want to. Now, I have also written some documentation for it (Wauv, I know...). So go to for the software, and here you can find a link to which contains the documentation for the downloadable software.


Saturday, November 22, 2008 12:03:14 AM (Romance Standard Time, UTC+01:00)  #    Comments [0]  | 
Thursday, November 20, 2008

Hi all

I have added a new functoid to the collection of functoids I am building. This time, I have programmed a functoid that converts between different datetime formats, which comes in handy when mapping between two schemas that have date elements, that require different formats of the date.

You can find version 4 of my functoid collection at


Thursday, November 20, 2008 12:41:07 AM (Romance Standard Time, UTC+01:00)  #    Comments [0]  | 
Wednesday, November 19, 2008

Hi all

Recently, I started using Windows Live Writer in large scale. Until then, I used the built in editing functionality of dasBlog, which is my blog software.

I must say, I love it!

Now, don't get me wrong, I have no other software products that do what Windows Live Writer does to compare it with, so there might be other and better products out there, but I am SO happy with not using the built in functionality of dasBlog anymore, I just had to tell you all :-)

The obvious advantages for using Windows Live Writer over the built in functionality in dasBlog are the possibility to work offline, either if my blog is unavailable or if I am in a train, and so on.

But also, I am quite fond of the way I can have multiple entries as work in progress at the same time, edit existing posts, etc. And all in a thick client on my laptop.

Really, I am quite thrilled :-) And I encourage all to use it... There is a newer version out than the 2008 that I am using, but it is a beta version, and some people have reported issues with using it against dasBlog, so I will wait a bit before I try that version.


Wednesday, November 19, 2008 10:37:11 PM (Romance Standard Time, UTC+01:00)  #    Comments [0]  | 
Tuesday, November 18, 2008

Hi all

This is the second post in a series about solving the "If-Then-Else" problem in a map. In my first post I discussed how to use BizTalks built-in functionality to solve the problem. Neither of the three proposed solutions really seem nice to me, so I wondered how difficult it might be to code a custom functoid that does the trick. It turned out to be unexpectedly hard, and this post tries to clarify my findings and explain them.

So, to continue from my previous post, to me the best solution is to code your own functoid, that mimics the value mapping functoid, but adds an "else" part. So basically just a third parameter to the value  mapping functoid that is returned in case the first parameter is false.

For information about how to program a custom functoid, please visit - I wont go into details about that here. I will just comment on the issues I have had with creating this particular functoid.

The final solution should give me the possibility to have a map like this one:


YES, I know my icons are very bad... Anyway, three inputs: a boolean and two values.

So, getting to the code, my first try looked like this:

this.Category = FunctoidCategory.ValueMapping;
this.OutputConnectionType = ConnectionType.AllExceptRecord;

I have removed irrelevant lines, such as setting up the resources, setting the ID, and so on.

First of all, in the code of a custom functoid, you need to specify which category the functoid should belong to. The possibilities are listed at I hadn't really looked at this list, since I thought that the intellisense in VS.NET 2005 was good enough. Since my functoid is an advanced value mapping functoid, I chose he value mapping category. This turned out a but different than I thought. It turns out, that the category you assign to a custom functoid not only determines where in the toolbox it should be placed, but also sometimes some extra functionality is added to the functoid. Given my map above, I had expected that the created XSLT would just call my functoid with the three parameters and then my code would do the rest. But the generated XSLT looks like this:

<?xml version="1.0" encoding="UTF-16"?>
<xsl:stylesheet xmlns:xsl="" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:var="" exclude-result-prefixes="msxsl var s0 userCSharp" version="1.0" xmlns:s0="" xmlns:ns0="" xmlns:userCSharp="">
  <xsl:output omit-xml-declaration="yes" method="xml" version="1.0" />
  <xsl:template match="/">
    <xsl:apply-templates select="/s0:InputRoot" />
  <xsl:template match="/s0:InputRoot">
    <xsl:variable name="var:v1" select="userCSharp:LogicalEq(string(qualifier/text()) , &quot;Jan&quot;)" />
      <xsl:if test="string($var:v1)='true'">
        <xsl:variable name="var:v2" select="IfTrue/text()" />
          <xsl:value-of select="$var:v2" />

I have removed all the lines associated with the equals-functoid as that included three inline c# methods which are irrelevant. Anyway, as you can see, my functoid is not being called at all. Because I chose the ValueMapping category, the generated xslt assumes it is actually a built-in value mapping functoid and it totally overrules the logic inside the functoid.

So, this really came as a surprise to me... but makes sense when you think about it, naturally. Some of the types of functoids just require logic that goes beyond the code inside a functoid.

So, the ValueMapping category just didn't work for me. Then I thought; "Oh, who cares?"? I will just use the String category instead, because those certainly do not have weird functionality around them... they get input and return a string as output, that is it. And the functoid will just appear in the String group in the toolbox in VS.NET.

That gave me a new headache, that was another surprise; You cannot connect the output of a logical functoid to the input of a string functoid. So... I was stuck.

One of my solutions would accept the output of a logical functoid as input, but my functoid logic was overridden. The other simply wouldn't accept the output of a logical functoid as input.

I have tried the following FunctoidCategories:

Category Description
Assert Terminates when logical functoid returns true. Has the wrong value in output field when logical functoid returns false.
Conversion Cannot connect output of logical functoid to input.
Count Cannot connect output of logical functoid to input.
Cumulative Cannot connect output of logical functoid to input.
DatabaseExtract Cannot connect output of logical functoid to input.
DatabaseLookup Cannot connect output of logical functoid to input.
DateTime Cannot connect output of logical functoid to input.
ExitenceLooping Cannot connect output of logical functoid to input.
Index Cannot connect output of logical functoid to input.
Iteration Cannot connect output of logical functoid to input.
Keymatch Cannot compile. You get an "Object not set to an instance of an object" exception.
Logical The output field isn't created.
Looping Cannot connect output of logical functoid to input.
MassCopy Cannot connect output of logical functoid to input.
Math Cannot connect output of logical functoid to input.
NilValue Only creates output field if logical functoid returns true and then it adds the xsi:nil attribute and no value in the output field.
Scientific Cannot connect output of logical functoid to input.
Scripter The scripting functoid has no script type set, either external or inline, so proper code cannot be generated for it.
String Cannot connect output of logical functoid to input.
TableExtractor Cannot connect output of logical functoid to input.
TableLooping Needs the table grid configured and is therefore useless.
Unknown Cannot connect output of logical functoid to input.
ValueMapping Only creates the output field if the logical functoid returns true.
XPath Cannot connect output of logical functoid to input.

So, basically, I haven't been able to do it... for now. Either I cannot connect a logical functoid to my custom functoid, I get an error either at compile time or something goes wrong semantically at runtime.

I haven't given up 100% yet... but I must say, that the task has turned out to be a whole lot more difficult than I thought it would be.

Look out for a part 3 in this series... if it comes, I will have solved this issue :-)


Tuesday, November 18, 2008 1:01:32 AM (Romance Standard Time, UTC+01:00)  #    Comments [1]  | 
Sunday, November 16, 2008

Hi all

I am doing a lot of functoid implementation these days, and therefore, I have for instance decided to find out what these FunctoidCategories are and where in the toolbox the different categories belong.

In the toolbox, we have the following groups of functoids:

  • String
  • Mathematical
  • Logical
  • Date/Time
  • Conversion
  • Scientific
  • Cumulative
  • Database
  • Advanced

I still remember my first custom functoid - I was really expecting that in my code I could decide in which group my functoid should appear and maybe even create my own group. But that isn't the case. There are 24 different FunctoidCategories that I can assign my functoid, and only the above 9 groups. You can read more about the different functoid categories here. Basically, I will just give a very short resumé of this information and then I will match each category to a group in the toolbox, so you have this information for future reference.

So, this is what I know:

Category Toolbox group Description
Assert Advanced For internal use only.
Conversion Conversion Converts characters to and from their numeric representation, and to convert numbers from one base to another.
Count Advanced For internal use only.
Cumulative Cumulative Performs various kinds of accumulation of the value of a field that occurs multiple times in a source document and outputs a single output.
DatabaseExtract Database For internal use only.
DatabaseLookup Database For internal use only.
DateTime Date/Time Adds date, time, date and time, or add days to a specified date, in output data.
ExistenceLooping Advanced For internal use only.
Index Advanced For internal use only.
Iteration Advanced For internal use only.
Keymatch Advanced For internal use only.
Logical Logical Controls conditional behavior of other functoids to determine whether particular output data is created.
Looping Advanced For internal use only.
MassCopy Advanced For internal use only.
Math Mathematical Performs specific numeric calculations such as addition, multiplication, and division.
NilValue Advanced For internal use only.
Scientific Scientific Performs specific scientific calculations such as logarithmic, exponential, and trigonometric functions.
Scripter Advanced For internal use only.
String String Manipulates data strings by using well-known string functions such as concatenation, length, find, and trim.
TableExtractor Advanced For internal use only.
TableLooping Advanced For internal use only.
Unknown Advanced For internal use only.
ValueMapping Advanced For internal use only.
XPath Advanced For internal use only.

To see this for your self, download

. Unzip the zip file, copy the dll to "%BTS%\Developer Tools\Mapper Extensions", where %BTS% is the installation folder of BizTalk. Then go to VS.NET 2005 and reload the toolbox. If you want use one of the functoids, remember to also GAC the dll. All the functoids have the exact same implementation, but they do not generate the same XSLT by the mapper because of the chosen category. Perhaps a new blog post on that later on...


Sunday, November 16, 2008 11:57:44 PM (Romance Standard Time, UTC+01:00)  #    Comments [0]  | 
Saturday, November 15, 2008

Hi all

I have often wondered why the built-in functoids doesn't encompass an If-Then-Else functoid. The Value Mapping functoid only has an If-Then-part and not the Else-part.

This is the first of two blog posts. This post will explore how to solve the issue with the built-in functionality of BizTalk. The next post will be about creating a custom functoid to do the job instead and the issues that come with this task.

So, using the built-in functionality:

Imagine this input schema:


And imagine this output schema:


My goal, now is to create a map that will map the value of the "ifJan" element to the destination IF the "qualifier" element equals the word "Jan" and otherwise the value of the "ifNotJan" element should be mapped.

So basically, given this input:

<ns0:IfThenElseInput xmlns:ns0="http://IfThenElse.IfThenElseInput">

I want this output:

<ns0:IfThenElseOutput xmlns:ns0="http://IfThenElse.IfThenElseOutput">

And given this input:

<ns0:IfThenElseInput xmlns:ns0="http://IfThenElse.IfThenElseInput">

I want this output:

<ns0:IfThenElseOutput xmlns:ns0="http://IfThenElse.IfThenElseOutput">

Using a map and the built-in functoids, that would look like this:


Basically, you need one value mapping functoid for each possible value to pass on, and a logical functoid for each value as well, to use in the value mapping functoid. The "String Concatenate" functoid is just my way of returning the string to use for the qualifier - in this case: "Jan".

You can also do it using one scripting functoid like this:


where the scripting functoid is an "Inline XSLT Call Template" scripting type, and the script looks likes this:

<xsl:template name="IfThenElse">
  <xsl:param name="qualifier" />
  <xsl:param name="ifJan" />
  <xsl:param name="ifNotJan" />
  <xsl:element name="field">
      <xsl:when test="$qualifier='Jan'">
        <xsl:value-of select="$ifJan" />
        <xsl:value-of select="$ifNotJan" />

Now... IF my good friend Henrik Badsberg is reading this, then by now he is screaming: "USE A BLOODY C# SCRIPTING FUNCTOID!!!!!" :-)

This, naturally is also an option:


with an "Inline C#" script containing this script:

public string IfThenElse(string qualifier, string ifJan, string ifNotJan)
  if (qualifier == "Jan")
    return ifJan;
    return ifNotJan;

Both scripting solutions can be altered to accept the output of a logical functoid as the first input. Just change the string "Jan" to "true" in the scripts, and change the name of the parameter if you want.

Now then... I am not a big fan of either of these three options. Generally, I avoid scripting functoids when I can because it is difficult for a new developer to know what is happening when he opens the map because he will have to open up all scripting functoids and find out (and remember) what they do. Also, I am not really a big fan of the first solution either. First of all, there are too many functoids, and it can messy if this solution is needed several times in a map. Secondly, you get a warning every time you compile, because you have two inputs to one element.

You can find my project with the three working maps here.

In my next post, I will look into creating a custom functoid that does the job and I can tell you right now; That isn't as easy as I had imagined...


Saturday, November 15, 2008 9:49:40 PM (Romance Standard Time, UTC+01:00)  #    Comments [0]  | 

Hi all

On October 29'th I did a BizTalk presentation for the Aalborg .NET User Group. It was the first in AANUG, so it makes sense that the topic should be the best topic ever :-)

Those who were present will remember that I completely broke the time frame I was bound by, and didn't even make it all the way through my presentation.

Weird, how I always get side tracked when I talk about something I am good at and/or like :-)

Anyway, this blog post has two purposes:

  1. Just a little more advertising for Aalborg .NET User Group. If you live close by, sign up and come to our meetings
  2. To make the slides available.

    They can be found here.

    Only in Danish, I am afraid.


Saturday, November 15, 2008 12:35:36 PM (Romance Standard Time, UTC+01:00)  #    Comments [0]  | 
Friday, November 14, 2008

Hi all

So, I have just added one more functoid to the collection of functoids. This time, I have added a string replace functoid, as I think that is really missing from the standard functoids that BizTalk supplies.

You can get version 3 of my functoid collection here:

And for those of you that are not bothered to read further on the download page than the download section, let me just repeat some text from the download page:


As you can probably see from my extremely lousy icons, layouts, and so on, graphics really isn't one of my strong sides. So if you are good at creating icons and so on, and would like to help me with this part, please contact me.



Friday, November 14, 2008 2:48:50 PM (Romance Standard Time, UTC+01:00)  #    Comments [0]  | 

Hi all

I have just added a new functoid to my collection (which now consists of TWO functoids :-) ). This new functoid is a functoid that simply returns a new GUID.

You can download it at


Friday, November 14, 2008 2:23:33 PM (Romance Standard Time, UTC+01:00)  #    Comments [0]  | 
Thursday, November 13, 2008

Hi all

I have had on my to do list for ages, that I should start developing some functoids that might be nice to have.

Well, finally I have started, and my first functoid can be downloaded from

Note, that the domain has just been moved from one hosting company to another, which means that the link might not work for another day or so.

Comments, bug reports, suggestions, and so on are very welcome.


Thursday, November 13, 2008 8:51:29 PM (Romance Standard Time, UTC+01:00)  #    Comments [0]  | 

Hi all

I have changed the config of my blog software (dasBlog) so all comments have to be approved by me. I hate to have to do this, but apparently, the upgrade to a newer version has made it easy for spammers to write silly comments with links to all sorts of weird web sites (I guess they are weird - naturally, I have never clicked on one...). I have already delete 5 inappropriate comments to posts, and they seem to come faster and faster.

I will ask the programmers of dasBlog to see what is happening, and then disable the approval flow once I have it solved.

I apologize for the inconvenience.


Thursday, November 13, 2008 12:07:42 AM (Romance Standard Time, UTC+01:00)  #    Comments [0]  | 
Wednesday, November 12, 2008

Hi all

So, it is time for the second part of the series about using the FarPoint BizTalk adapter for Excel spreadsheets. You can find my first post in the series, which was about the installation of the component here.

So, this post is about the wizard that guides you through creating a schema for an Excel spreadsheet.

I created a simple spreadsheet to test with. It has two sheets, which you can see here:



Basically, two sheets - one with order lines and one with comments. So, firing up the wizard:


The first thing to do is to add a new item to your project, and choose the new schema type "Spreadsheet Schema Wizard". The wizard fires up automatically, when you click "Add".


The first screen of the wizard isn't really a surprise :-) It wants to you tell it which file to use as a base for the schema, and give a target namespace and inform it about what code page to use.


When browsing for files, I noticed that the components apparently not only deals with spreadsheets (Excel 97-2003 as well as 2007) but also delimited files. So note to my self: Look at that functionality later on - maybe it is better than BizTalks built-in support for that, or perhaps more suitable in some situations. Maybe that's a blog post that will appear at some point :-)


So, a few more settings to set, all of which are described in the documentation.


Now, it shows me the data in the first sheet of the spreadsheet. It has removed all cells that it has decided are not used for data. Now, I need to select the cells with data in them, like this:


and when I click on the next sheet (Comments), I get to select data from that sheet as well:


Notice, that I can only select rows - I can not select single cells or leave some columns out.


The next step is to select names for the columns, choose whether they should be elements or attributes and also the data type of the columns.


There are four data types available, double, float, datetime and string.


Just to find the difference between the float and double, I chose one of each in my example and clicked "Finish".


The resulting schema looks like the one above. For each sheet, there is a sheetname attribute, a header record and a record for the data, which is reoccurring. The double and float elements were translated into the xs:float and xs:double types... not really surprising, you might say :-)


Looking at the properties of the schema, the path to the base spreadsheet has been pre filled for you in the "Input Instance Filename" and the type is set to "Native".


When validating the instance, I get this XML, which looks like I expected it to.

So, to sum up, the wizard is really simple to use and it takes basically no time to create the schema.

The major thing I would like to see improved is that I can only have one type of data in one sheet, meaning that the data in all rows must be for instance order lines, inventory items, or something like that. I can't have an order header and the order lines in the same sheet, and I can't have a sheet with an order header which spans multiple lines. This really restricts the spreadsheets that can be parsed.

My next post in the series will be about the runtime, where I will setup a running instance of my project and see how it functions at runtime.

You can dowload my project here.


Wednesday, November 12, 2008 1:08:57 AM (Romance Standard Time, UTC+01:00)  #    Comments [0]  | 
Tuesday, November 11, 2008

Hi all

For those of you, who use Togi as a Twitter client, there is now a Danish translation of it available for download... and, as you will notice on the page, I did the Danish translation :-) Although... I use the English version myself... but that is besides the point :-)


Tuesday, November 11, 2008 2:27:46 AM (Romance Standard Time, UTC+01:00)  #    Comments [0]  | 
Monday, November 10, 2008

Hi all

So, I finally decided to try out the FarPoint BizTalk adapter for Excel spreadsheets. It's always nice to have tried as many adapters as possible, so I can use this knowledge when talking to customers.

This post is the first of a series of posts about this product. The first post is about installation and the basic functionality. The next posts will go deeper into separate functionality.

Let me just make one thing clear before I begin: I am not in any way affiliated with FarPoint Technologies, nor are they paying me anything to write these posts.

So, to begin; The installation was easy. Just a next-next-finish wizard. All the information needed from you is the product code, a serial number, and the installation folder, if you want to change that.

After installation, I have the functionality I would expect from this kind of product:

  1. Pipeline components to use in pipelines
    excel_disassembler_component excel_assembler_component
  2. Schema extension for the schemas
  3. Wizard to help me create the schemas
  4. Documentation

So, to sum up:

  1. The installation is easy.
  2. The architecture of the solution seems to be exactly what I would expect, ie. pipeline components, schema extensions and a wizard.

My next post in the series will take a deeper look at the wizard for creating schemas for use by the pipeline disassembler and assembler.


Monday, November 10, 2008 11:49:25 PM (Romance Standard Time, UTC+01:00)  #    Comments [2]  | 

Hi all

In almost all multiple server installations of BizTalk I have encountered, there has been issues with MSDTC. MSDTC is Microsofts product for handling distributed transactions, meaning transactions that span multiple servers. BizTalk uses this in high scale, when running transactions against SQL Server, to maintain consistency in BizTalks databases.

All issues with MSDTC are solvable - sometimes it is just hard to figure out what is wrong.

First of all, always use the DTCTester tool at to test your MSDTC installation. If this tool reports no errors and you are still having issues, then most likely, MSDTC isn't the cause of your issues.

If something is wrong with MSDTC, I have encountered four major issues:

  1. MSDTC doesn't run on either of the server. Solve this by starting MSDTC. Steps to start MSDTC (Note, that the MMC snapin is buggy, and it might appear that the "Component Services" node has no children... but it does, trust me :-) ):
    1. Go to "Administrative Tools" => "Component Services"
    2. Go to "Component Services" => "Computers" => "My Computer"
    3. Right click "My Computer" and choose "Start MS DTC".
  2. MSDTC isn't configured for network access on both servers. Solve this in "add/remove windows components" here:
  3. The two servers have the same MS DTC ID. This ocurs if both servers are clones of the same server or if one of the ervers is a clone of the other server. Usually, when cloning servers, sysprep is used to clear out those errors, but in case it hasn't been used, here is how you fix it:
    1. Run "msdtc -uninstall" from a command prompt
    2. reboot
    3. Run "msdtc -install" from a command prompt
    4. reboot
  4. You can't ping the servers by hostname, which is required. This basically means, that from both servers, you need to be able to ping the other server by hostname - pinging by IP address isn't enough. If you can't ping by hostname, you have two options:
    1. Get the network administrator to update your DNS
    2. Enter new information into the hosts file in c:\windows\system32\drivers\etc

Hope this helps.


Monday, November 10, 2008 7:28:38 PM (Romance Standard Time, UTC+01:00)  #    Comments [0]  | 
Sunday, November 9, 2008

Hi all

Finally, I have managed to end the upgrading-hell it has been. I am now up to version 2.2.8279.16125 of dasBlog, and this is currently the latest release. I didn't have the guts to upgrade directly from 1.9 to 2.2, so I went over 2.0 and 2.1 to get there.

To me, everything looks ok - let me know if you discover anything else.


Sunday, November 9, 2008 2:28:27 AM (Romance Standard Time, UTC+01:00)  #    Comments [1]  | 

Hi all

I have just upgraded dasBlog to 2.1.8102.813.

I hope this hasn't introduced weird behavior. Please contact me if you encounter errors or issues.



Sunday, November 9, 2008 1:15:46 AM (Romance Standard Time, UTC+01:00)  #    Comments [0]  | 

Hi all

I have just upgraded to dasBlog version 2.0.7226.0.

I am hoping it went without issues, but would appreciate an email if you discover any issues.



Sunday, November 9, 2008 12:47:38 AM (Romance Standard Time, UTC+01:00)  #    Comments [0]  | 

Theme design by Jelle Druyts