Biztalk 2004 Development Helper Tool – A Must Have

A lot can be said about development with Biztalk Server.  For someone new to Biztalk it takes a little practice to learn some of the non-intuitive tasks related to assembly redeployment and basic Biztalk Development.



One common error message is:


Some items in the removed assembly are still being used by items not defined in the same assembly, thus removal of the assembly failed.


Make sure that items in the assembly you are trying to remove fulfill the following conditions:


1. Pipelines, maps, and schemas are not being used by Send Ports or Receive Locations


2. Roles have no enlisted parties.


 


The most common problem I see is what is required to redeploy an assembly.  To redeploy an assembly the flowing must be true:



  • project is marked with redeploy = true

  • dependant assemblies but be undeployed

  • included maps and pipelines can not still be set on a send or receive port

  • Orchestration instances must be terminated

  • Orchestrations must be stopped and unenlisted

  • hosts must be restarted to release the cache

As the number of Ports, Maps, Orchestation, and Pipelines in your solution increase, tracking down these errors and manually stopping and starting can be difficult and time consuming.



I have put together a simple Windows Application that will perform some of these basic administrative tasks to help speed up the development process.  These tasks include:



  • Set all pipeline to default and remove all maps from Send and Receive Ports (make sure you have extracted your current settings as a binding file before hand)

  • Stop all Orchestrations

  • Stop all Send and Receive Ports

  • Start all Orchestrations

  • Start all Send and Receive Ports

  • Restart all in-process hosts (uses WMI)


All this simple form does is it loops around the existing ExplorerOM and WMI provided in Biztalk. 



Download: Biztalk Server Development Helper Tool



Setup is easy.  Just review the code and run the form.  You must have the correct permissions to run the tasks and to access a remote SQL.  If you are using a remote SQL Server, put that server name inside the top right text box.  It will default to your local computer name.  As always, run this code at your own risk.



Biztalk 2006 greatly simplifies this process.  In the mean time, if you are looking for something more powerful take a look at Jon Flander’s Biztalk Snapshot Tool


 

Biztalk Development Helper Tool

This tool can help with development with Biztalk 2004. This tool will start and stop Orchestration, start and stop Send and Receive Port, remove pipelines and map from Send and Receive Port, and restart all in-process Biztalk Hosts. This tool is a great resource for any Biztalk developer. This should also work with BizTalk 2006.

Get more information from the original blog post on this topic: http://www.biztalkgurus.com/biztalk_server/biztalk_blogs/b/biztalk/archive/2005/09/07/biztalk-2004-development-helper-tool-_2d00_-a-must-have.aspx

Windows Workflow Webcasts

The world as we know it is about to change – for the better. 



To get ready for this exciting new offering Microsoft has announced a week of Workflow Webcasts to run the week of September 26th.



Webcasts include:




Anyone currently working with Biztalk and Workflows should make every effort to attend these webcasts or view them later via live play.



You can get all the details from Paul Andrew blog.


 


Make sure you check out the new Windows Workflow Foundation page of BizTalkGurus.com for samples and videos.


 

Where does WSE 2.0 fit into BizTalk 2004?

Over the next few posts, I’m going to explore where, and
how, WSE 2.0 fits in with BizTalk 2004.  I know some of you are thinking,
well, we have this wonderful WSE adapter that allows us to retreive SOAP
messages and have all the (or at least some) of the benefits of WSE
(WS-Addressing, WS-Policy, etc).  That’s true, we do…  BUT, what happens if we want to receive
messages over a transport other than HTTP?  Many times, in a SOA
environment it is necessary to support guaranteed delivery.  This is not
possible over HTTP.  WSE gives us the ability to define our own custom
transports.  Therefore, from a WSE standpoint we could receive messages via
MQ to support our guaranteed delivery requirement.  If we do that then we
can’t use the WSE adapter.

On my current project, I’m exploring ways of
dealing with WSE compliant messages, without using the WSE adapter.  This
of course will require development of a custom pipeline to deal with some of the
things the adapter takes care of like handling the WS-Addressing headers,
digital certificates, etc.  Another thing I’m exploring is implementing WSE
pipelines inside of a BizTalk pipeline.  This allows you to add custom
filters to the WSE pipeline through configuration…pretty powerful.  I’m
not sure what the implications, if any, are however.

Stay tuned as I post my findings!!

Cheers,

Todd

A PST for the PDC…

Unfortunately, I won’t be able to make it to the PDC this year…However, a good colleague
by the name of Jordan Terrell has put together this great
PST file for the PDC with all the sessions as calendar appointments. (Open as
a data file in Outlook, and in the Calendar view, you will be able to select a calendar
corresponding to each of the conference tracks.)

A PST for the PDC…

Unfortunately, I won’t be able to make it to the PDC this year…However, a good colleague
by the name of Jordan Terrell has put together this great
PST file for the PDC with all the sessions as calendar appointments. (Open as
a data file in Outlook, and in the Calendar view, you will be able to select a calendar
corresponding to each of the conference tracks.)

Using Dynamic Transforms (Mapping) in Biztalk 2004 Orchestrations

Dynamic mapping is the concept of specifying the map to be used for a transform at runtime inside the orchestration. That means no Transform Shape is used to specify the map or input and output schemas.



The help guide talks about dynamic mapping. It is under the heading “Assigning to Transforms Dynamically”. The help guide does not go into any detail as to when or why you would want to use dynamic mapping. In fact, the help guide makes the topic seems more complex then it really is.



Dynamic transforms can be used any time you have the same business process that needs to have the same or different message types sent into it but they need to have different maps based on some parameter.



Example: We are receiving a standard invoice from multiple locations for the same vendor. The schema is exactly the same but the mapping of the vendor data to the base schema (date formats, currency conversion, etc.) is slightly different based on the vendor location.



Why not map on the Receive Port? This is the most common solution to this type of scenario. This uses document normalization to transform all your messages into the same type before it hits your business process. This is a great solution but what about exceptions?



Exceptions in maps on the Receive Port can be hard to react to and even harder to orchestrate a retry or recovery process. That is when mapping inside an Orchestration and Dynamic Maps come into play.



Calling maps inside an Orchestration provide a mechanism for exception handling, reprocess, and error notification. Dynamic maps allow for greater flexibility by allowing countless maps to be called without a Transform Shape.



With dynamic maps, the map name can be stored inside an attribute in the message, read from the SSO, or read from some other custom component. Then, it is as simple as creating a System.Type with the strong fully qualified map name.



This would look something like this:


tMapType = System.Type.GetType(“DynamicMaps.Map_A, DynamicMaps, Version=1.0.0.0, Culture=neutral, PublicKeyToken=faed587cb93de4ea”);



construct Out_Xml


{


transform (Out_Xml) = tMapType(In_Xml);


}



If the map is inside the same assembly as the Orchestration, the full strong name is not needed. On that note, your maps usually are always inside a separate assembly…



It is important to point out this code needs to be inside an Expression Shape. The help guide says a Message Assignment shape. But, that will give a build error. If you want to use the code inside a Message Assignment shape just remove the Construct key word.



Sounds too good to be true? This does have one major drawback. If the message type of the input message does not match the message type expected in the map you get a blank message contracted. This can be seen in the sample below by running the RunMapType_ConstructBlank.xml message. So, it is import to check for this after the map.



I have put together a sample the shows dynamically calling maps inside an Orchestration both in the same assembly and inside another assembly.



Download: Dynamic Maps Inside an Orchestration



It is also common to see dynamic maps used with untyped messages (that is messages received as XmlDocuments).