BizTalk 2006 Adapter for Microsoft Dynamics CRM Released

BizTalk 2006 Adapter for Microsoft Dynamics CRM Released

I knew we were releasing the BizTalk 2006 Dynamics CRM Adapter in September, and it looks like it just came in under the wire. Check
out Ryan Toenies post for more info, and, the download link.
Note that this is a *send* adapter only, but, I love that we can still do the “Add Generated Items” on the adapter and interrogate the
Dynamics CRM actions and objects.

Technorati Tags:

TimRayburn.CustomFunctoids – If … Else

TimRayburn.CustomFunctoids – If … Else

This post is part of an ongoing series, the
explanation of which can be found here.

This
one should be of more use to our friends using BizTalk Server 2006.  Today we
tackle a problem that anyone who has ever mapped an EDI 837 I/P/D has had to deal
with, and probably solved with hundreds of “Value Mapping” functoids and Logical Not
(if you are on 2006) functoids.

The out of the box functoid set gives you a very nice “Value Mapping” functoid which
is great because it compiles to an xsl:if tag.  But if you want to do a simple
If A then B else C type logic you are left with either two value map functoids and
a Logical Not (or Logical Equal in 2004) functoids, or you are writing a scripting
functoid.  Either way you have hampered the readability of your map, and in the
case of the value map solution you’ve netted yourself a compiler warning for two links
to one node for each and every node you had to do this with.  If it is an 837
that you’re doing this with, that is a TON of nodes in the 2300 and
2400 loops.

The solution?  IfElseFunctiod of course!  This class, added to the TimRayburn.CustomFunctoids
project, takes three parameters.  The first is a boolean, the second is the value
returned if true, the third is the value returned if false.  It is important
to note that in any case, if connected directly to the output schema this will produce
a node.  It is not a XSLT functoid and cannot suppress the output node. 
For now if you need to do that, you’re still stuck with putting in a Value Mapping
functoid.

The newly added class can be found below.  It is nearly identical to last night’s
functoid of course.  Interestingly, I tried to refactor this class and the other
to create a base class that handled assigning the ID and resources.  When I did
so, BizTalk stopped recognizing that the assembly contained any functoids.  Apparently
your custom functoids must not simply inherit from BaseFunctoid, they must be
direct children of BaseFunctoid.

Download
v1.1 of TimRayburn.CustomFunctoids

   10     class IfElseFunctoid : BaseFunctoid
   11    
{
   12     
   public IfElseFunctoid()
   13     
   {
   14     
       // Assign a "unique" id
to this functiod
   15     
       this.ID = 24602;
   16 
   17     
       // Setup the resource assembly
to use.
   18     
       SetupResourceAssembly(
   19     
          "TimRayburn.CustomFunctoids.CustomFunctoidsResources",
   20     
          Assembly.GetExecutingAssembly());
   21 
   22     
       SetName("IDS_IFELSEFUNCTOID_NAME");
   23     
       SetTooltip("IDS_IFELSEFUNCTOID_TOOLTIP");
   24     
       SetDescription("IDS_IFELSEFUNCTOID_DESCRIPTION");
   25     
       SetBitmap("IDB_IFELSEFUNCTOID_BITMAP");
   26 
   27     
       this.SetMinParams(3);
   28     
       this.SetMaxParams(3);
   29 
   30     
       SetExternalFunctionName(this.GetType().Assembly.FullName,
   31     
          "TimRayburn.CustomFunctoids.IfElseFunctoid",
   32     
          "IfElse");
   33 
   34     
       this.Category = FunctoidCategory.ValueMapping;
   35     
       this.OutputConnectionType
= ConnectionType.AllExceptRecord;
   36 
   37     
       AddInputConnectionType(ConnectionType.AllExceptRecord);
   38     
       AddInputConnectionType(ConnectionType.AllExceptRecord);
   39     
       AddInputConnectionType(ConnectionType.AllExceptRecord);
   40     
   }
   41 
   42     
   public string IfElse(string booleanValue, string trueValue, string falseValue)
   43     
   {
   44     
       bool bVal = System.Convert.ToBoolean(booleanValue);
   45     
       if (bVal)
   46     
          return trueValue;
   47     
       else
   48     
          return falseValue;
   49     
   }
   50    
}

Factory Furore

Factory Furore

Well, I cant help feeling highly amused at the goings on in this particular area. No sooner had David Hayden written a post praising the Web Service Software Factory to the skies than Udi Dahan comes out with the ‘anti’ view in an article titled “WSSF – Data Access Crud .


So what seems to be the problem? The way I read it, it appears that Udi doesnt like the idea of having a Business Logic Layer separate from the DAL. I like Udi’s posts in general and they make a lot of sense so this particular post did dampen my enthu for the WSSF at first, however, after some thought, i guess my own perspective on this is that (a) this tool is a great example of what can be achieved with the GAT stuff , (b) this is extensible so if you want to code generate using your own OR mappers or naming standards, it shouldnt be a problem and (c) so what? hundreds of developers use that 3 layered pattern. Of course, just because they use it doesnt mean its right and it may not be pure OO but you cant fault the WSSF team for following a well known pattern. Maybe someone will come up with a factory that satisfies the OO purists.


I’m going to do a bit more reading up on this. Paul Gielens appears to have dealt with the issue of Organizing Domain Logic in some detail in his post where he walks through the design of PetShop 4.0 contrasting the Three Layered Services Application pattern used in it vs. the Domain Driven Design. I’ve started to look at it and it looks quite interesting so far, so i’ll chew on it for a while and then post my thoughts on the same.


Ultimately, i see the WSSF and other factories as key tools in my teams and my own toolbox. We’ve already put WSCF (Web Service Contract First) to good use and its helped us create some really clean ASMXs so i will look at the ASMX guidance in the software factory and see how it compares/aligns with WSCF.  I wonder if the WSSF team will respond to Udis comments!

Computing Careers RSS Feed

I’m sure they are behind the times, but Computing Careers have just released their job searches as RSS feeds!
I’m can now get details of the latest permanent/contract BizTalk jobs delivered straight to Bloglines! Note to self: must get certified before the end of the year
The feed is available here:

Computing Careers RSS Feed – simply enter […]

TimRayburn.CustomFunctoids – Logical NOT

TimRayburn.CustomFunctoids – Logical NOT

The first in a series of posts on my functoids library.  More
information can be found here.
  While I realize that Logical NOT has been
added to the base set of functoids in BizTalk 2006, this class will still be useful
for those who want to take the code and compile it under Visual Studio 2003 and use
it with BizTalk 2004.  Nothing will be used in this or future functoids which
does not compile in both versions.

Alright,
time for the first functoid.  This first time I will provide a step by step detail
of how to create the project and the related references, etc.  In future, this
will be skipped for brevity.  Most of this same information can be found by going
to C:\Program Files\Microsoft BizTalk Server 2006\SDK\Samples\XmlTools\CustomFunctoid and
examining the sample project there which shows how to create custom functoids.

To that end, we will need to setup a project for all of these functoids.  Opening
Visual Studio 2005, we create a C# project (Sorry Cory)
and then create a strong name adjust the AssemblyInfo.cs to use our strong name, because
like all BizTalk assemblies this will have to be in the GAC.  Then we need to
add a reference to Microsoft.BizTalk.BaseFunctoids.dll, this assembly holds the base
libraries off of which we can build functoids and can be found at c:\Program
Files\Microsoft BizTalk Server 2006\Developer Tools
on most boxes. 
When you’ve reached this point your Solution Explorer should look like the one to
the right.

Now that the project is created, we need to setup the class.  We’ll rename Class1.cs
as LogicalNotFunctoid.cs.  Likewise we will rename the class within the file
as LogicalNotFunctoid.  All functoids derive from Microsoft.BizTalk.BaseFunctoids.BaseFunctoid
and ours will be no exception.  We’ll add a default constructor which overloads
the same in our base class and your code should now look like this:

    1 using System;
    2 using System.Collections.Generic;
    3 using System.Text;
    4 using Microsoft.BizTalk.BaseFunctoids;
    5 
    6 namespace TimRayburn.CustomFunctoids
    7 {
    8     public class LogicalNotFunctoid : BaseFunctoid
    9    
{
   10     
   public LogicalNotFunctoid() : base()
   11     
   {
   12 
   13     
   }
   14    
}
   15 }

Next we need to add the necessary code to assign the functoid an ID, and to set the
resource file where information such as the name and other information will come from. 
Most of this is simple copy-paste from the example in the SDK folder.  We will
have also added a CustomFunctoidsResources.resx to the solution to hold all these
resources.  I will not detail the creation of the resource file here, if you’d
like to learn about this download the source it is fairly self-evident.  Once
you’ve gotten the basic constructor down it should look something like this:

   10     
   public LogicalNotFunctoid() : base()
   11     
   {
   12     
       // Assign a "unique" id
to this functoid.
   13     
       this.ID = 24601;
   14 
   15     
       // Setup the resource assembly
to use.
   16     
       SetupResourceAssembly(
   17     
          "TimRayburn.CustomFunctoids.CustomFunctoidsResources", 
   18     
          Assembly.GetExecutingAssembly());
   19 
   20     
       SetName("IDS_LOGGICALNOTFUNCTOID_NAME");
   21     
       SetTooltip("IDS_LOGGICALNOTFUNCTOID_TOOLTIP");
   22     
       SetDescription("IDS_LOGGICALNOTFUNCTOID_DESCRIPTION");
   23     
       SetBitmap("IDB_LOGGICALNOTFUNCTOID_BITMAP");
   24 
   25     
       this.SetMinParams(1);
   26     
       this.SetMaxParams(1);
   27     
   }

Now we need to tell the class how we expect this functoid to be called.  It will
need to be part of the Logical group, it should take a minimum of 1 parameter and
a maximum of 1 parameter and it should take connections from anything that is not
a Record (as Records contain no values).  Add those lines of code and now we
look like:

   10     
   public LogicalNotFunctoid() : base()
   11     
   {
   12     
       // Assign a "unique" id
to this functoid.
   13     
       this.ID = 24601;
   14 
   15     
       // Setup the resource assembly
to use.
   16     
       SetupResourceAssembly(
   17     
          "TimRayburn.CustomFunctoids.CustomFunctoidsResources", 
   18     
          Assembly.GetExecutingAssembly());
   19 
   20     
       SetName("IDS_LOGGICALNOTFUNCTOID_NAME");
   21     
       SetTooltip("IDS_LOGGICALNOTFUNCTOID_TOOLTIP");
   22     
       SetDescription("IDS_LOGGICALNOTFUNCTOID_DESCRIPTION");
   23     
       SetBitmap("IDB_LOGGICALNOTFUNCTOID_BITMAP");
   24 
   25     
       this.SetMinParams(1);
   26     
       this.SetMaxParams(1);
   27 
   28     
       //set the function name
that needs to be 
   29     
       //called when this Functoid
is invoked. This means that
   30     
       //this Functoid assembly
need to be present in GAC 
   31     
       //for its availability
during Test..Map and Runtime.
   32     
       SetExternalFunctionName(this.GetType().Assembly.FullName, 
   33     
          this.GetType().FullName, "LogicalNot");
   34 
   35     
       this.Category = FunctoidCategory.Logical;
   36     
       this.OutputConnectionType
= ConnectionType.AllExceptRecord;
   37 
   38     
       AddInputConnectionType(ConnectionType.AllExceptRecord);
   39     
   }

 All that remains now is to create the method which will actually perform the
Logical Not.  This of course is simple after all of the above as long as you
remember that your input value will be a string because all data is a string to XML
and as such your boolean will arrive as “true” or “false”.  I’ve written this
to use System.Convert.ToBoolen so you can also handle inputs like “y” or “n” and the
like.

   41     
   public string LogicalNot(string booleanValue)
   42     
   {
   43     
       bool bVal = System.Convert.ToBoolean(booleanValue);
   44     
       if (bVal)
   45     
          return "false";
   46     
       else
   47     
          return "true";
   48     
   }

 Now we just need to compile the project, place it in the GAC, put a copy in c:\Program
Files\Microsoft BizTalk Server 2006\Developer Tools\Mapper Extensions
 and
then add it to our Toolbox.  The result gives us something like this:

 

Download
TimRayburn.CustomFunctoids Version 1.0

Virtual Desktop Manager in XP PowerToys

Today someone complained about Windows XP’s lack of virtual desktops and that Mac had the possibility to have several desktops active with different content. I remembered that had tried something like that a couple of years ago and after a while I found Microsoft PowerToys for Windows XP again.
The PowerToys package contains several small XP add-ins. For example the Virtual […]

TimRayburn.CustomFunctoids

TimRayburn.CustomFunctoids

Another new post series that I’ve been meaning to start for a while.  This post
kicks off the development of a new project called TimRayburn.CustomFunctoids. 
The idea behind this project is that, in my not so humble opinion, there are several
big gaps in the provided functiods that come with BizTalk.  To that end, I intend
to begin a library of functoids that can be used by anyone who would like them, subject
to the license for all content on the blog. 

Here are the rules I will using to guide the creation of these functoids:

  1. As each functoid is completed, a new post to the blog will be created with the details
    of the implementation and the source code.

  2. All functoids will have icons in the theme of the group in which they belong. 
    For instance String functoids will have a red background, etc.

  3. All functoid icons will have a bright blue border for the outer pixel to clearly mark
    them as being part of an external assembly.

  4. All functoid ids will be incremented from a base value of 24,601. (Bonus Question
    : Where did I get the number 24,601?)

  5. The goal of all functoids will be to make maps more clear, not less clear.  Icons
    will be as descriptive as possible and you will not see functoids like “Lunar Moon
    Phase Functoid”.

The first functoid that will be created is a pet peeve of mine … Logical NOT.

BizTalk 2006 and Windows Workflow Foundation (.NETFX 3.0)

BizTalk 2006 and Windows Workflow Foundation (.NETFX 3.0)

I’m getting around to it!

A while back I did a MSDN Webcast on this topic, and I also presented upon this at
the Australian Teched 2006.

During my sessions I used a whole bunch of demo code etc.

It is my mission to make this available to you (took me around 15 months to design
+ implement this for a client). I want to make available a demo version for you folks
to enable to you get in a get your hands dirty.

The two worlds live together quite nicely! BTS 2006 and WinWF.

You dont have to decide whether I’ll write lines of code with WinWF or for those ‘enterprise’
solutions…time to use BizTalk. Not a chance.

I’ll show you how to drive Workflow Solutions from within a BizTalk framework enabling
things like BAM, HAT etc etc for the whole story.

Stay tuned and watch this space!…..within the week! I promise!

Sydney BizTalk User Group – we did a first!! RFID session

Sydney BizTalk User Group – we did a first!! RFID session

You know the tags….Minority Report…intelligent fridges and washing machines knowing how to wash your clothes for you (guys…this could be our moment of fame! rather than everything coming out ‘pink’ and then you get banned from the washing machine for life!)

David McGhee ran
an RFID session at the Sydney
BizTalk User Group
and a big thanks!! I’ll be grabbing his slide deck in the next
couple of days and posting it up.

And a big thanks to Matt Eschbach from Intermec.com in
coming to the Party with some hardware goodies, gadgets (mobile readers and fixed
readers to come) AS WELL AS A SAMPLE RFID Application that runs within the framework.
How good is that!!!!

I’ll be developing some apps going forward so that initially the User Group members
each get their own tag and can use that as an attendance indicator for each meeting.
These results will eventually be sent back to the User
Group Site
. Who know we may even get some sort of live voting going during sessions……(if
you enjoyed the session go down this line to a beer…..if you didnt….go down this
beer line 🙂

Here’s some technical specifications from Matt about the devices – once again thanks
Matt.

7X1a_spec_web.pdf
(356.49 KB)

IP4_spec_web.pdf
(114.22 KB)