<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Evan Koch</title>
        <link>http://geekswithblogs.net/evankoch/Default.aspx</link>
        <description>Musings on BizTalk Server 2006 and SQL Server 2005</description>
        <language>en-US</language>
        <copyright>Evan Koch</copyright>
        <managingEditor>evankoch23@gmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <image>
            <title>Evan Koch</title>
            <url>http://geekswithblogs.net/images/RSS2Image.gif</url>
            <link>http://geekswithblogs.net/evankoch/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>Failed Message Routing</title>
            <link>http://geekswithblogs.net/evankoch/archive/2008/04/04/121052.aspx</link>
            <description>&lt;p&gt;&lt;font face="Arial"&gt;One of the things Microsoft introduced with BizTalk 2006 is failed message routing.  Prior to this, developers had to come up with custom solutions to remove failed messages from the messagebox to prevent them from accumulating.  Now all one has to do is enable routing for failed messages on the receive ports and create an orchestration to consume these failed messages.  When a message comes into the messagebox, BizTalk tries to find a matching subscription based on the context properties of the message.  If no matching subscriptions are found, the message is suspended.  To demonstrate this we can create a receive location and drop in a XML file.  Checking in the Group Hub we find the following:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="71" width="438" alt="" src="/images/geekswithblogs_net/evankoch/FailedMessageRouting/suspendedMessage.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;These messages can be handled if failed message routing is enabled for the receive port that handled the message.  &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="253" width="428" alt="" src="/images/geekswithblogs_net/evankoch/FailedMessageRouting/ReceivePortProperties.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;The other half of this solution is to create an orchestration to handle the failed messages.  For this example we’ll write the failed messages out to the file system.  The receive port is directly bound to the messagebox.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="227" width="509" alt="" src="/images/geekswithblogs_net/evankoch/FailedMessageRouting/FailedMessagesOrchestration.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;The properties of the message in this orchestration are shown below.  Rather than specifying a schema for the message type, declaring a value of XmlDocument makes this orchestration flexible enough to consume all types of failed messages rather than restricting it to a particular schema.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="182" width="287" alt="" src="/images/geekswithblogs_net/evankoch/FailedMessageRouting/FailedMessage.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;The receive shape in this orchestration has a filter expression to limit it to messages with an ErrorType context property value of FailedMessage.  There are a number of context properties that are included for all messages.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="251" width="480" alt="" src="/images/geekswithblogs_net/evankoch/FailedMessageRouting/ReceiveShapeFilter.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;With this in place, messages that do not match any subscriptions are consumed by the orchestration and written to disk.&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121052"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121052" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/evankoch/aggbug/121052.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Evan Koch</dc:creator>
            <guid>http://geekswithblogs.net/evankoch/archive/2008/04/04/121052.aspx</guid>
            <pubDate>Sat, 05 Apr 2008 02:13:46 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/evankoch/comments/121052.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/evankoch/archive/2008/04/04/121052.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/evankoch/comments/commentRss/121052.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/evankoch/services/trackbacks/121052.aspx</trackback:ping>
        </item>
        <item>
            <title>Inbound Maps</title>
            <link>http://geekswithblogs.net/evankoch/archive/2008/04/04/121051.aspx</link>
            <description>&lt;p&gt;&lt;font face="Arial"&gt;In one of the previous examples that talked about convoys within BizTalk, I had the following orchestration:In one of the previous examples that talked about convoys within BizTalk, I had the following orchestration:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="465" alt="" width="533" src="/images/geekswithblogs_net/evankoch/InboundMaps/OldOrchestration.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;The purpose of this map within the orchestration was to receive a message that followed the Claim schema, transform it into the ClaimValidation schema and set the Status to CONTRACT VALIDATION COMPLETED.  It’ll see a bit contrived, but we can move the map so that it’s called on the receive port if required so that we’ll always be dealing with a ClaimValidation message inside of the orchestration.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;We’ll also use the map from the previous example which determined the Pass/Fail Validation response based on whether or not the ClaimID is odd.&lt;br /&gt;
&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;img height="141" alt="" width="460" src="/images/geekswithblogs_net/evankoch/InboundMaps/Map.png" /&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;font face="Arial"&gt;Within the orchestration we’ll still construct an outbound message and set the Status.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;img height="416" alt="" width="465" src="/images/geekswithblogs_net/evankoch/InboundMaps/newOrchestration.png" /&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;font face="Arial"&gt;Since the inbound map (which we’ll discuss in a bit) happens before the orchestration runs, the receive port deals only with messages of the ClaimValidation schema.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;img height="381" alt="" width="281" src="/images/geekswithblogs_net/evankoch/InboundMaps/InboundPortConfiguration.png" /&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;font face="Arial"&gt;After the orchestration is deployed, we can specify the inbound map on the physical receive port in BizTalk Administration Console.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;img height="232" alt="" width="641" src="/images/geekswithblogs_net/evankoch/InboundMaps/InboundMapConfiguration.png" /&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;font face="Arial"&gt;With this in place, we can drop messages of the Claim and ClaimValidation schemas into the receive locations.  If the message is of the Claim schema, it will first be transformed into the ClaimValidation schema, and if it’s of the ClaimValidation schema it will pass directly through to the orchestration.&lt;br /&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;font face="Arial"&gt;\Source code for this example can be found &lt;a href="http://www.box.net/shared/bs8aaxssg4"&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121051"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121051" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/evankoch/aggbug/121051.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Evan Koch</dc:creator>
            <guid>http://geekswithblogs.net/evankoch/archive/2008/04/04/121051.aspx</guid>
            <pubDate>Sat, 05 Apr 2008 01:58:54 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/evankoch/comments/121051.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/evankoch/archive/2008/04/04/121051.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/evankoch/comments/commentRss/121051.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/evankoch/services/trackbacks/121051.aspx</trackback:ping>
        </item>
        <item>
            <title>Parallel Convoys</title>
            <link>http://geekswithblogs.net/evankoch/archive/2008/04/04/121050.aspx</link>
            <description>&lt;p&gt;&lt;font face="Arial"&gt;Taking decoupled orchestrations one step further, we’ll use it to do multiple concurrent tasks and then associate the output from those tasks.  We’ll borrow our scenario for this example from the health care industry.  When a claim is submitted, there are multiple types of validation that happens (and by no means is this a comprehensive list): is this a valid contract?  Is the hospital part of the network?  Is the procedure performed covered?  We’ll take two of those for our scenario.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="300" alt="" width="324" src="/images/geekswithblogs_net/evankoch/Convoys/Claim Process.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;With decoupled orchestrations we can create an orchestration for each one of the steps above.  In this case, both the Validate Hospital Information and Validate Contract Information receive shapes will have filters that are looking for messages matching the Claim schema with a status of CLAIM RECEIVED.  &lt;/font&gt;&lt;/p&gt;
&lt;font face="Arial"&gt;
&lt;p&gt;It’s worth discussing the messaging engine of BizTalk here.  When an orchestration is deployed to the BizTalk database, it is necessary to enlist the orchestration and then start it.  Enlisting the orchestration defines the subscription for the orchestration and BizTalk can form a queue of messages for the orchestration to consume.  When the orchestration is started, it will then begin consuming the messages that are in the queue.  When a message is received, BizTalk examines the message’s context properties and sees what subscriptions match them.  Each orchestration with a subscription that matches the context properties, so when the ReceiveClaim orchestration writes a message to the messagebox with a Status of CLAIM RECEIVED, the message is placed in the queue for the ValidateHospitalInformation orchestration and in the queue for the ValidateContractInformation  orchestration.&lt;/p&gt;
&lt;p&gt;Rather than generating the same output for each claim, I’ve made the output for each of the Validation orchestrations dependant on the ClaimID: if the ClaimID is even, the validation will fail; if the ClaimID is odd, the validation will pass.  I’m doing this logic in a map within the orchestration (I’ll use this as an example for inbound maps in a later post).  The map takes in a message of the Claim and generates a message of the ClaimValidation schema.  The validation orchestrations update the Status according to what was performed (CONTRACT VALIDATION COMPLETED for ValidateContractInformation and HOSPITAL VALIDATION COMPLETED for ValidateHospitalInformation) and proceed to send the outbound messages to the messagebox.&lt;/p&gt;
&lt;p&gt;The ProcessClaim orchestration requires input from both the ValidateContractInformation and ValidateHospitalInformation orchestrations and needs to ensure that the results it uses are for the same claim.  To accomplish this, we define a correlation set based on ValidationClaimID.&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;&lt;img height="568" alt="" width="396" src="/images/geekswithblogs_net/evankoch/Convoys/ClaimID Correlation Type.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;This is what ensures that BizTalk consumes both the contract and hospital validation results for claim 123 together rather than the contract validation result from claim 234 and the hospital validation result from claim 345.  Correlation sets can only be based on promoted properties, so the ClaimValidation schema has two promoted properties – ValidationClaimID and ValidationStatus.  The ValidationStatus is used for the filter condition of the two receive shapes shown below, and also note that both receive shapes reference the ClaimIDCorrelationSet.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="581" alt="" width="697" src="/images/geekswithblogs_net/evankoch/Convoys/ProcessClaim.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Below are the properties for the two receive shapes.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="269" alt="" width="538" src="/images/geekswithblogs_net/evankoch/Convoys/Receive Contract Validation Config.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="266" alt="" width="541" src="/images/geekswithblogs_net/evankoch/Convoys/Receive Hospital Validation config.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Another benefit of the correlation set we defined is that should one of the validation orchestrations take longer than the other to run, the output from the completed validation orchestration will be held until it can be paired with the output from the other validation orchestration, though this will not affect other instances of the messages or orchestrations.  To demonstrate this, I’ve stopped the ValidateContractInformation orchestration but the ValidateHospitalInformation is still running.  After submitting a test claim, we can view the messages.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="183" alt="" width="626" src="/images/geekswithblogs_net/evankoch/Convoys/Convoy on hold.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;The output from the ValidateHospitalInformation orchestration is waiting to be paired with output from the ValidateContractInformation orchestration.  When the ValidateContractInformation is started and the suspended instance is resumed, the ProcessClaim orchestration will consume both messages and output the result to the file system.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Source code for this example can be found &lt;a href="http://www.box.net/shared/xtiar93c48"&gt;here&lt;/a&gt;.&lt;/font&gt;&lt;/p&gt;
&lt;/font&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121050"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121050" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/evankoch/aggbug/121050.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Evan Koch</dc:creator>
            <guid>http://geekswithblogs.net/evankoch/archive/2008/04/04/121050.aspx</guid>
            <pubDate>Sat, 05 Apr 2008 01:36:52 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/evankoch/comments/121050.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/evankoch/archive/2008/04/04/121050.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/evankoch/comments/commentRss/121050.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/evankoch/services/trackbacks/121050.aspx</trackback:ping>
        </item>
        <item>
            <title>Multi-part Messages</title>
            <link>http://geekswithblogs.net/evankoch/archive/2007/10/31/116486.aspx</link>
            <description>&lt;p&gt;&lt;font face="Arial"&gt;Using multi-part messages is first in Marty Wasznicky’s article &lt;a href="http://msdn.microsoft.com/msdnmag/issues/07/05/BizTalk/"&gt;8 Tips and Tricks For Better BizTalk Programming&lt;/a&gt; &lt;br /&gt;
so I thought I might demonstrate this technique in more depth.  My experience with multi-part messages has been when I want to define a single message to pass among loosely coupled orchestrations that contains all the messages associated with the initial loan request.  This post also uses code from some of my previous posts, so some of it should look familiar.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Multi-part message types can be defined within BizTalk so that a message can contain parts associated with various schemas.  For this example, we’ll use a multi-part message to contain the initial loan request and the mortgage documents request.  Below is a diagram of the process.&lt;br /&gt;
&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;/font&gt; &lt;img height="321" width="206" alt="" src="/images/geekswithblogs_net/evankoch/MultipartMessages/LoanProcessDiagram.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;font face="Arial"&gt;In the main orchestration that calls each task we’ll create the multi-part message and pass it into the other orchestrations as they are called.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="546" width="550" alt="" src="/images/geekswithblogs_net/evankoch/MultipartMessages/Master Orchestration.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;font face="Arial"&gt;The multi-part message is defined so that one of the message parts follows the LoanRequest schema while the second part follows the PreparedLoan schema.  I’ve defined the LoanRequest part as the message body which will come into play in the ArchiveLoan orchestration.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="134" width="292" alt="" src="/images/geekswithblogs_net/evankoch/MultipartMessages/MultipartMessageDefinition.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="206" width="348" alt="" src="/images/geekswithblogs_net/evankoch/MultipartMessages/LoanRequestMessagePart.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="186" width="376" alt="" src="/images/geekswithblogs_net/evankoch/MultipartMessages/PreparedLoanMessagePart.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;font face="Arial"&gt;Each part of the multi-part message can be assigned separately within a Message Assignment shape.  In this case I’m setting the LoanRequest equal to the initial message and the PreparedLoan equal to a XML variable that contains an unpopulated MortgageDocuments node.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="66" width="698" alt="" src="/images/geekswithblogs_net/evankoch/MultipartMessages/MultipartAssignment.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt; &lt;/font&gt;&lt;font face="Arial"&gt;In the Prepare Loan orchestration we’ll pass the loan request through a policy to generate the documents for the mortgage.  Since the message is being passed by reference, we have no need for output parameters – the main orchestration’s copy of the multi-part message is being updated within the Prepare Loan orchestration.  To determine which mortgage documents are needed, the loan is passed through a rule policy.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt; &lt;img height="167" width="547" alt="" src="/images/geekswithblogs_net/evankoch/MultipartMessages/PrepareLoan Orchestration.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;The rule policy needs instances of both the LoanRequest and PreparedLoan schema to run, though we’re able to pass in the various parts of the multi-part message to satisfy this requirement.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt; &lt;img height="161" width="477" alt="" src="/images/geekswithblogs_net/evankoch/MultipartMessages/PrepareLoanDocumentsPolicy.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;In the GenerateLoanDocuments orchestration, we only want to send the contents of the PreparedLoan message part to the SendGenerateLoanDocuments port.  &lt;/font&gt;&lt;/p&gt;
&lt;p&gt; &lt;img height="366" width="552" alt="" src="/images/geekswithblogs_net/evankoch/MultipartMessages/GenerateLoanDocuments orchestration.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;For the purposes of associating the Send shape with a message, we’re not able to consider each part of the multi-part message separately, so we create a message of the PreparedLoan type first and assign it to be the same as the multi-part message’s PreparedLoan part.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt; &lt;img height="48" width="503" alt="" src="/images/geekswithblogs_net/evankoch/MultipartMessages/GenerateLoanDocumentsMessage.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;And finally we have the ArchiveLoan orchestration.  In this instance we send the multi-part message to the Send port, but what is actually written to the file system might be different than what one would expect: while the entire multi-part message is sent, only the message body (in this case, the LoanRequest message part) is written to the file system.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt; &lt;img height="168" width="551" alt="" src="/images/geekswithblogs_net/evankoch/MultipartMessages/ArchiveLoan Orchestration.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Source code for this example can be found &lt;a href="http://www.box.net/shared/yhej5o2aid"&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=116486"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=116486" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/evankoch/aggbug/116486.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Evan Koch</dc:creator>
            <guid>http://geekswithblogs.net/evankoch/archive/2007/10/31/116486.aspx</guid>
            <pubDate>Wed, 31 Oct 2007 14:41:28 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/evankoch/comments/116486.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/evankoch/archive/2007/10/31/116486.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/evankoch/comments/commentRss/116486.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/evankoch/services/trackbacks/116486.aspx</trackback:ping>
        </item>
        <item>
            <title>Using Debug Statements in BizTalk</title>
            <link>http://geekswithblogs.net/evankoch/archive/2007/10/17/116089.aspx</link>
            <description>&lt;p&gt;&lt;font face="Arial"&gt;One of the things I’ve found useful in Biztalk development are debug statements.   True, you can use the orchestration debugger and view the values of messages as the orchestration runs, but it can be a good bit easier to have the orchestrations write debug statements when they reach certain points.  To accomplish this you can put calls to System.Diagnostics.Debug.WriteLine in the Expression and Message Assignment shapes and watch them using DebugView (which can be downloaded &lt;a href="http://www.microsoft.com/technet/sysinternals/utilities/debugview.mspx"&gt;here&lt;/a&gt;).&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;For this example I’ve got a main orchestration that receives a loan request and another orchestration that determines if the loan is approved or not based on the credit score.  Throughout both orchestrations we’ll write statements to indicate our current tasks.&lt;br /&gt;
&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;/font&gt; &lt;img height="303" width="540" alt="" src="http://geekswithblogs.net/images/geekswithblogs_net/evankoch/DebugView/MainOrchestration.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;font face="Arial"&gt;In the Debug Statement expression shape below I’ve specified the following line of code:&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;/font&gt; &lt;img height="147" width="578" alt="" src="/images/geekswithblogs_net/evankoch/DebugView/DebugExpression.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;font face="Arial"&gt;And this is the Approval orchestration:&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;/font&gt; &lt;img height="478" width="619" alt="" src="/images/geekswithblogs_net/evankoch/DebugView/ApprovalOrchestration.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;font face="Arial"&gt;In this case the debug statements are embedded into the message assignment shapes.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;/font&gt; &lt;img height="185" width="577" alt="" src="/images/geekswithblogs_net/evankoch/DebugView/DebugAssignmentStatement.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;font face="Arial"&gt;After deploying these orchestrations, opening DebugView and submitting a few loans the following is displayed:&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;/font&gt; &lt;img height="225" width="573" alt="" src="/images/geekswithblogs_net/evankoch/DebugView/DebugView.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;The statements can be as detailed as you wish to make them.  The other thing worth pointing out is that calls to the System.Diagnostics.Debug library may be removed during compilation depending on the current compilation statement mode.  If you want to be able to control whether or not the debug statements are written via a configuration file setting to debug something in a production environment, you may consider using System.Diagnostics.Trace.WriteLine instead, as these calls will not be removed during compilation.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Source code for this sample can be found &lt;a href="http://www.box.net/shared/6ips28kh20"&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=116089"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=116089" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/evankoch/aggbug/116089.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Evan Koch</dc:creator>
            <guid>http://geekswithblogs.net/evankoch/archive/2007/10/17/116089.aspx</guid>
            <pubDate>Wed, 17 Oct 2007 13:41:11 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/evankoch/comments/116089.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/evankoch/archive/2007/10/17/116089.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/evankoch/comments/commentRss/116089.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/evankoch/services/trackbacks/116089.aspx</trackback:ping>
        </item>
        <item>
            <title>Missing Images</title>
            <link>http://geekswithblogs.net/evankoch/archive/2007/10/10/115974.aspx</link>
            <description>I checked my blog this morning only to find that the images were missing from the last five or so posts I had made.  Not quite sure what happened, but I've uploaded the images again.  My apologies to anyone who read a post recently and was unable to view the images, but they should be there now.&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=115974"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=115974" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/evankoch/aggbug/115974.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Evan Koch</dc:creator>
            <guid>http://geekswithblogs.net/evankoch/archive/2007/10/10/115974.aspx</guid>
            <pubDate>Wed, 10 Oct 2007 11:57:35 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/evankoch/comments/115974.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/evankoch/archive/2007/10/10/115974.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/evankoch/comments/commentRss/115974.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/evankoch/services/trackbacks/115974.aspx</trackback:ping>
        </item>
        <item>
            <title>Using the BRE outside of BizTalk</title>
            <link>http://geekswithblogs.net/evankoch/archive/2007/10/04/115855.aspx</link>
            <description>&lt;p&gt;Recently I've wanted to demonstrate using the BizTalk Rules Engine outside of BizTalk.  In our post 9/11 world, everyone's probably had some contact with the heightened security and restrictions for air travel and banking transactions.  Along the same lines, the Nuclear Regulations Commission often updates the rules concerning access control to nuclear power plants within the United States.  Knowing the flexibilty of the BRE and the ease with which new rules can be added and deployed, I thought this was a good premise for my example.&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;For the purposes of this example, one of the assumptions is that a XML is provided to the system containing the information for the employee following the schema below:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt; &lt;img height="202" alt="" width="269" src="/images/geekswithblogs_net/evankoch/UsingTheBREOutsideOfBizTalk/AccessRequestSchema.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Within the code this XML document is loaded into an XMLDocument variable, used to create a TypedXMLDocument variable, and then passed to Access Control policy within the BRE.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt; &lt;img height="110" alt="" width="550" src="/images/geekswithblogs_net/evankoch/UsingTheBREOutsideOfBizTalk/LoadTypedXMLDocument.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;So then let’s look at the rules.  The first rule to be executed is “Grant Access.”  While probably not the best idea when handling real world situations, for the purposes of this example I grant access to the employee in question and then check criteria to determine if that access should be revoked.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt; &lt;img height="235" alt="" width="328" src="/images/geekswithblogs_net/evankoch/UsingTheBREOutsideOfBizTalk/GrantAccess.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;The criteria used for this rule is just a way of making the rule execute every time.  The BRE uses the &lt;a href="http://en.wikipedia.org/wiki/Rete_algorithm"&gt;RETE algorithm&lt;/a&gt; and other things I don’t fully understand but enjoy the benefits of nonetheless to generate an agenda of which rules to try based on the input.  In this case I’ve declared a priority of 1 for the Grant Access rule to ensure that it is run before the other rules.  Below is the text displayed within the Business Rule Composer for Priority:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt; &lt;img height="84" alt="" width="301" src="/images/geekswithblogs_net/evankoch/UsingTheBREOutsideOfBizTalk/Priority.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;So then we evaluate other things.  Is the person requesting access currently employed?  If not, deny access and add a &amp;lt;AccessDeniedReason&amp;gt; node.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt; &lt;img height="184" alt="" width="577" src="/images/geekswithblogs_net/evankoch/UsingTheBREOutsideOfBizTalk/CurrentlyEmployed.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Did the person pass his or her last drug test? &lt;/font&gt;&lt;/p&gt;
&lt;p&gt; &lt;img height="180" alt="" width="576" src="/images/geekswithblogs_net/evankoch/UsingTheBREOutsideOfBizTalk/LastDrugTestResult.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Was the last drug test performed within the last 60 days?  Note here that the BRE calls an external function which takes in an integer represents how long drug tests should be considered valid, so if the NRC were to change it to 45 or 30 days, all one would have to do is update the parameter.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt; &lt;img height="168" alt="" width="573" src="/images/geekswithblogs_net/evankoch/UsingTheBREOutsideOfBizTalk/LastDrugTestPeriod.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="137" alt="" width="616" src="/images/geekswithblogs_net/evankoch/UsingTheBREOutsideOfBizTalk/CalculateDrugTestValidity.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;We submit the following access request and are denied access.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt; &lt;img height="209" alt="" width="335" src="/images/geekswithblogs_net/evankoch/UsingTheBREOutsideOfBizTalk/AccessRequest1.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;img height="252" alt="" width="476" src="/images/geekswithblogs_net/evankoch/UsingTheBREOutsideOfBizTalk/AccessRequest1Results.png" /&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;The following employee is granted access.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt; &lt;img height="193" alt="" width="349" src="/images/geekswithblogs_net/evankoch/UsingTheBREOutsideOfBizTalk/AccessRequest2.png" /&gt;&lt;/p&gt;
&lt;p&gt; &lt;img height="252" alt="" width="476" src="/images/geekswithblogs_net/evankoch/UsingTheBREOutsideOfBizTalk/AccessRequest2Results.png" /&gt;&lt;/p&gt;
&lt;font face="Arial"&gt;By determining whether or not the employee has access within the BRE, we’re afforded a high degree of flexibility when it comes to implementing new rules.  If the NRC were to come out with a list of names that should be denied access, the developer could create a rule that would check first and last names against a database table.  Source code for this example can be found &lt;a href="http://www.box.net/shared/z669kqq5jx"&gt;here&lt;/a&gt;.&lt;/font&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=115855"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=115855" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/evankoch/aggbug/115855.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Evan Koch</dc:creator>
            <guid>http://geekswithblogs.net/evankoch/archive/2007/10/04/115855.aspx</guid>
            <pubDate>Thu, 04 Oct 2007 20:18:27 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/evankoch/comments/115855.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/evankoch/archive/2007/10/04/115855.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/evankoch/comments/commentRss/115855.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/evankoch/services/trackbacks/115855.aspx</trackback:ping>
        </item>
        <item>
            <title>Tightly Coupled Orchestrations</title>
            <link>http://geekswithblogs.net/evankoch/archive/2007/10/04/115853.aspx</link>
            <description>&lt;p&gt;&lt;font face="Arial"&gt;Considering the last post concerned loosely coupled orchestrations, I thought it might be useful to demonstrate tightly coupled orchestrations.  This method still can promote reuse as orchestrations can be called from multiple sources.  We’ll use the same loan process diagram.&lt;/font&gt;&lt;/p&gt;
&lt;font face="Arial"&gt;
&lt;p&gt;&lt;img height="321" width="206" alt="" src="/images/geekswithblogs_net/evankoch/TightlyCoupledOrchestrations/LoanProcessDiagram.png" /&gt;&lt;br /&gt;
And here’s the layout of the master orchestration.  In this case we don’t have a Send shape at the end because that’s being handled in the Archive Loan orchestration.  &lt;/p&gt;
&lt;p&gt;&lt;img height="380" width="466" alt="" src="/images/geekswithblogs_net/evankoch/TightlyCoupledOrchestrations/MasterOrchestration.png" /&gt;&lt;br /&gt;
Orchestrations can have a few types of parameters, though I’ve only used message parameters before.  Each message parameter is associated with a direction: the parameter can be passed in by value by the calling orchestration, passed out by reference to the calling orchestration, and there’s a ref option to pass in a parameter by reference.&lt;/p&gt;
&lt;p&gt;&lt;img height="391" width="428" alt="" src="/images/geekswithblogs_net/evankoch/TightlyCoupledOrchestrations/OrchestrationParameters.png" /&gt;&lt;br /&gt;
In the PrepareLoan and GenerateLoanDocuments I create a copy of the message and assign a new status value to indicate that something has happened, since I’m not really doing any other work in the orchestration.&lt;/p&gt;
&lt;p&gt;&lt;img height="258" width="498" alt="" src="/images/geekswithblogs_net/evankoch/TightlyCoupledOrchestrations/GenerateLoanDocuments.png" /&gt;&lt;br /&gt;
As the messages are being passed by reference between one another, there’s no reason for the messages to be written to the Biztalk messagebox, which can be quite a boon to performance.&lt;/p&gt;
&lt;p&gt;Source code for this example can be found &lt;a href="http://www.box.net/shared/3cvjhgary2"&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;/p&gt;
&lt;/font&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=115853"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=115853" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/evankoch/aggbug/115853.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Evan Koch</dc:creator>
            <guid>http://geekswithblogs.net/evankoch/archive/2007/10/04/115853.aspx</guid>
            <pubDate>Thu, 04 Oct 2007 19:30:52 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/evankoch/comments/115853.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/evankoch/archive/2007/10/04/115853.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/evankoch/comments/commentRss/115853.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/evankoch/services/trackbacks/115853.aspx</trackback:ping>
        </item>
        <item>
            <title>Loosely Coupled Orchestrations</title>
            <link>http://geekswithblogs.net/evankoch/archive/2007/10/04/115852.aspx</link>
            <description>&lt;p&gt;&lt;font face="Arial"&gt;At its heart, BizTalk is based on the publish/subscription model.  As messages come in to the message box, BizTalk checks to see what orchestrations have subscriptions that match the criteria of the incoming message.  This pub/sub model is opens up a new paradigm for developers in terms of programming.  For this example we’ll use the following process diagram for lending:&lt;/font&gt;&lt;/p&gt;
&lt;font face="Arial"&gt;
&lt;p&gt;&lt;img height="321" alt="" width="206" src="/images/geekswithblogs_net/evankoch/LooselyCoupledOrchestrations/LoanProcessDiagram.png" /&gt;&lt;br /&gt;
A developer could create one monolithic orchestration to handle all the tasks shown above.  The downside of this would be that the entire orchestration would have to be modified if steps were added to the diagram above, nor would we be able to easily facilitate reuse.  Another option would be for the developer to create an orchestration for each of the steps above and then another orchestration to call the others and pass information between them.  A more interesting option, however, would be to create separate orchestrations and have them activate as needed.&lt;/p&gt;
&lt;p&gt;We can accomplish this by routing messages between the orchestrations.  Messages are routed based on their context properties, so we’ll add a Status element to our basic LoanRequest schema and make it a promoted property.&lt;/p&gt;
&lt;p&gt;&lt;img height="408" alt="" width="658" src="/images/geekswithblogs_net/evankoch/LooselyCoupledOrchestrations/LoanSchema.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
After the task is completed in each orchestration, we’ll create a copy of the message and update the status to indicate that the task has been completed.  After the new message has been created, it will be passed into the message box using a port that’s directly bound.   The following orchestration will be checking the messagebox looking for messages where the status indicates that the preceding orchestration has been completed.  &lt;/p&gt;
&lt;p&gt;&lt;img height="377" alt="" width="464" src="/images/geekswithblogs_net/evankoch/LooselyCoupledOrchestrations/Orchestration.png" /&gt;&lt;/p&gt;
&lt;p&gt;The following orchestration will have a receive port that’s directly bound to the message box.  The receive shape that’s connected to this port will have a filter that’s looking for messages where the Status context property indicates that the previous orchestration has completed.  For instance, we’ll look at the code in the Message Assignment block of the Prepare Loan orchestration. &lt;/p&gt;
&lt;p&gt; &lt;img height="78" alt="" width="533" src="/images/geekswithblogs_net/evankoch/LooselyCoupledOrchestrations/OutboundMsgCreation.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Let’s also take a look at the filter expression for the Receive shape in the GenerateLoanDocuments orchestration.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="191" alt="" width="553" src="/images/geekswithblogs_net/evankoch/LooselyCoupledOrchestrations/Filter.png" /&gt;&lt;/p&gt;
&lt;p&gt;So going back to the terms used at the beginning of this post, the PrepareLoan orchestration publishes a message to the messagebox which matches the subscription for the GenerateLoanDocuments orchestration and activates an instance of the orchestration.  Similarly, the GenerateLoanDocuments orchestration publishes a message to the messagebox with a Status value of “LOAN DOCUMENTS GENERATED” that matches the subscription for the ArchiveLoan orchestration and activates an instance to consume the message.&lt;/p&gt;
&lt;p&gt;As mentioned earlier, this type of model can more readily accommodate changes to the process diagram.  We’ll use the updated process diagram below.&lt;/p&gt;
&lt;p&gt;&lt;img height="410" alt="" width="196" src="/images/geekswithblogs_net/evankoch/LooselyCoupledOrchestrations/UpdatedLoanProcessDiagram.png" /&gt;&lt;/p&gt;
&lt;p&gt;In order to handle this, we’d create an additional orchestration that handled the specifics of the Generate MIN logic and activate it with a receive shape that looks for messages with a Status of “LOAN PREPARED”.  After the MIN logic has been performed, it will create a new message with a Status value of “MIN GENERATED”.  Additionally, the GenerateLoanDocuments receive port filter would need to be updated so that the filter expression matched the new Status value.  The direct bound ports are only logical ports and have no physical representations that can be updated within the BizTalk Administration Console, so this change can only be made at design time within Visual Studio.&lt;/p&gt;
&lt;p&gt;This pub/sub model could also be used to promote reuse in orchestrations.  Imagine that there was a new requirement that each step within the loan process be logged.  To accomplish this, we could create another orchestration  called LogProcess with a receive shape that had a filter on Status values of AUDIT.  Each orchestration could be updated to create a message for auditing with a Status value of AUDIT and send it to the messagebox before sending the other message indicating that the orchestration had completed its task.&lt;/p&gt;
&lt;p&gt;Source code for this example can be found &lt;a href="http://www.box.net/shared/pmt7yzmexg"&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;/p&gt;
&lt;/font&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=115852"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=115852" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/evankoch/aggbug/115852.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Evan Koch</dc:creator>
            <guid>http://geekswithblogs.net/evankoch/archive/2007/10/04/115852.aspx</guid>
            <pubDate>Thu, 04 Oct 2007 19:20:31 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/evankoch/comments/115852.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/evankoch/archive/2007/10/04/115852.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/evankoch/comments/commentRss/115852.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/evankoch/services/trackbacks/115852.aspx</trackback:ping>
        </item>
        <item>
            <title>Signing BizTalk Assemblies</title>
            <link>http://geekswithblogs.net/evankoch/archive/2007/10/02/115770.aspx</link>
            <description>&lt;p&gt;&lt;font face="Arial"&gt;While this isn’t exclusive to BizTalk assemblies, I can’t say I’ve had much need for strongly named assemblies prior to working with BizTalk.  When a BizTalk assembly is deployed, the assemblies are installed into the GAC.  For an assembly to be installed into the GAC, however, the assembly must be strongly named.  It’s easy enough to create a .snk file and open up the project properties and browse to the location of the .snk file, though it’s a recommended practice to &lt;a href="http://msdn.microsoft.com/msdnmag/issues/07/05/BizTalk/#S6"&gt;specify the assembly key file with a relative path&lt;/a&gt; rather than using an absolute path.  This practice can help reduce any frustrations on a project with multiple developers who may have varying preferences for source code location, etc.  There’s another way to share assembly keys among assemblies that might prove useful at some point.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Using the sn.exe to create assembly keys, I’d imagine most are reasonably familiar with the –k option.  One of the other options is –i which will install the specified key into a container.  &lt;br /&gt;
 &lt;br /&gt;
&lt;img height="290" alt="" width="578" src="/images/geekswithblogs_net/evankoch/Signing BizTalk Assemblies/sn Example.png" /&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;When modifying the project properties to specify an assembly key, you can specify this key container rather than pointing to the assembly key file.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="86" alt="" width="384" src="/images/geekswithblogs_net/evankoch/Signing BizTalk Assemblies/StrongName.png" /&gt;&lt;/p&gt;
&lt;p&gt;I’ve found this approach useful when there are multiple projects within one solution that share one assembly key – for instance, one BizTalk solution that had different projects for schemas, orchestrations, utilities, etc.  Using relative paths you could store the assembly key file in the solution folder and use relative paths, or you could install the assembly key into a container and specify the name of the container.  &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=115770"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=115770" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/evankoch/aggbug/115770.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Evan Koch</dc:creator>
            <guid>http://geekswithblogs.net/evankoch/archive/2007/10/02/115770.aspx</guid>
            <pubDate>Tue, 02 Oct 2007 11:12:38 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/evankoch/comments/115770.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/evankoch/archive/2007/10/02/115770.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/evankoch/comments/commentRss/115770.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/evankoch/services/trackbacks/115770.aspx</trackback:ping>
        </item>
    </channel>
</rss>