<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>BizTalk Messages &#187; Orchestrations</title>
	<atom:link href="http://biztalkmessages.vansplunteren.net/tag/orchestrations/feed/" rel="self" type="application/rss+xml" />
	<link>http://biztalkmessages.vansplunteren.net</link>
	<description>Randal van Splunteren&#039;s experiences with BizTalk Server and other MS technologies.</description>
	<lastBuildDate>Tue, 07 Feb 2012 08:01:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='biztalkmessages.vansplunteren.net' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>BizTalk Messages &#187; Orchestrations</title>
		<link>http://biztalkmessages.vansplunteren.net</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://biztalkmessages.vansplunteren.net/osd.xml" title="BizTalk Messages" />
	<atom:link rel='hub' href='http://biztalkmessages.vansplunteren.net/?pushpress=hub'/>
		<item>
		<title>Setting the filename in send port (post number:1023054)</title>
		<link>http://biztalkmessages.vansplunteren.net/2010/11/02/setting-the-filename-in-send-port-post-number1023054/</link>
		<comments>http://biztalkmessages.vansplunteren.net/2010/11/02/setting-the-filename-in-send-port-post-number1023054/#comments</comments>
		<pubDate>Tue, 02 Nov 2010 15:08:35 +0000</pubDate>
		<dc:creator>Randal van Splunteren</dc:creator>
				<category><![CDATA[BizTalk]]></category>
		<category><![CDATA[Adapters]]></category>
		<category><![CDATA[Orchestrations]]></category>

		<guid isPermaLink="false">https://biztalkmessages.wordpress.com/2010/11/02/setting-the-filename-in-send-port-post-number1023054/</guid>
		<description><![CDATA[This is probably the most blogged topic in the BizTalk community but I hope my attempt still adds something. Let’s start with some simple questions: Question1: What syntax do you need to use to access the filename of a message you received using the file adapter in an orchestration? In an expression shape you use [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biztalkmessages.vansplunteren.net&amp;blog=3912620&amp;post=869&amp;subd=biztalkmessages&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is probably the most blogged topic in the BizTalk community but I hope my attempt still adds something.</p>
<p>Let’s start with some simple questions:</p>
<p><strong><u>Question1:</u>       <br /></strong><strong>What syntax do you need to use to access the filename of a message you received using the file adapter in an orchestration?</strong></p>
<p>In an expression shape you use something like this:</p>
<p>myVariable = myMessage(File.ReceivedFileName);</p>
<p><strong><u>Question 2:        <br /></u>Ok, that one was easy! Now the same question for the a message received using the FTP adapter?</strong></p>
<p>Again in an expression shape use:</p>
<p> myVariable = myMessage(<a href="ftp://ftp.ReceivedFileName">FTP.ReceivedFileName</a>);</p>
<p><strong><u>Question 3:       <br /></u> Ok, makes sense. So what do you need to do when you wan to set the filename for a message that you send out using the file adapter?</strong></p>
<p>Easy, two steps needed: </p>
<p>1). Set the filename property in the send port to use the macro %SourceFileName%.   <br />2). Set the context property in the orchestration to the filename you want to use, like this:</p>
<p>myMessage(FILE.ReceivedFileName) = “MyFileName.xml”;</p>
<p>The file adapter will replace the macro with the value of the context property.</p>
<p><strong><u>Question 4:       <br /></u></strong><strong>Last question; Same question for the FTP adapter. How do you set the filename for a message that you want to send out using the ftp adapter?</strong></p>
<p>myMessage(<a href="ftp://ftp.ReceivedFileName">FTP.ReceivedFileName</a>) = “MyFtpFileName.xml”;</p>
<p><strong><font color="#ff0000" size="3">Wrong!!!!!!!! </font></strong>you also need to use the same syntax as with the file adapter:</p>
<p>myMessage(<a href="ftp://ftp.ReceivedFileName">FILE.ReceivedFileName</a>) = “MyFtpFileName.xml”;</p>
<p>This is something I encountered during development last week. I think this is a little confusing. It took me a while to find out what happened here. Also, by searching the internet, if found out this seems to confuse more people. </p>
<p>I think the idea behind this is an attempt to make an orchestration adapter agnostic and to create an abstraction layer between the logical process (orchestration) and the adapters which are bound to a certain technology or protocol. So whether you use the file or FTP adapter it is always ‘FILE.ReceivedFileName’ you need to use. This idea is good but my remarks are:</p>
<p>- This works different for receive side which makes it a little inconsistent.   <br />- The word ‘FILE’ is (at least in my head) directly connected to the file adapter. The abstraction would be more clear if some other term was used.</p>
<p>Confusing!</p>
<br /> Tagged: <a href='http://biztalkmessages.vansplunteren.net/tag/adapters/'>Adapters</a>, <a href='http://biztalkmessages.vansplunteren.net/tag/biztalk/'>BizTalk</a>, <a href='http://biztalkmessages.vansplunteren.net/tag/orchestrations/'>Orchestrations</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/biztalkmessages.wordpress.com/869/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/biztalkmessages.wordpress.com/869/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/biztalkmessages.wordpress.com/869/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/biztalkmessages.wordpress.com/869/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/biztalkmessages.wordpress.com/869/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/biztalkmessages.wordpress.com/869/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/biztalkmessages.wordpress.com/869/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/biztalkmessages.wordpress.com/869/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/biztalkmessages.wordpress.com/869/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/biztalkmessages.wordpress.com/869/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/biztalkmessages.wordpress.com/869/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/biztalkmessages.wordpress.com/869/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/biztalkmessages.wordpress.com/869/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/biztalkmessages.wordpress.com/869/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biztalkmessages.vansplunteren.net&amp;blog=3912620&amp;post=869&amp;subd=biztalkmessages&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://biztalkmessages.vansplunteren.net/2010/11/02/setting-the-filename-in-send-port-post-number1023054/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">biztalkmessages</media:title>
		</media:content>
	</item>
		<item>
		<title>Orchestration Expression Window Sizeable in BizTalk 2010</title>
		<link>http://biztalkmessages.vansplunteren.net/2010/04/08/orchestration-expression-window-sizeable-in-biztalk-2010/</link>
		<comments>http://biztalkmessages.vansplunteren.net/2010/04/08/orchestration-expression-window-sizeable-in-biztalk-2010/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 19:30:09 +0000</pubDate>
		<dc:creator>Randal van Splunteren</dc:creator>
				<category><![CDATA[BizTalk]]></category>
		<category><![CDATA[BizTalk 2010]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Orchestrations]]></category>

		<guid isPermaLink="false">http://biztalkmessages.wordpress.com/?p=664</guid>
		<description><![CDATA[The text below is based on the beta release of BizTalk 2010. It might not (completely) apply to the RTM release. So what is the greatest new feature in BizTalk 2010? For me it is by far sizeable code window for expression shapes and message assignment shapes in the orchestration designer. Although this seems like [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biztalkmessages.vansplunteren.net&amp;blog=3912620&amp;post=664&amp;subd=biztalkmessages&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><em>The text below is based on the beta release of BizTalk 2010. It might not (completely) apply to the RTM release.</em></p>
<p>So what is the greatest new feature in BizTalk 2010? For me it is by far sizeable code window for expression shapes and message assignment shapes in the orchestration designer.</p>
<p>Although this seems like a small improvement it was many times requested and really makes the live of a BizTalk developer easier.</p>
<p>If you follow my blog you might know I wrote the <a href="http://biztalkmessages.vansplunteren.net/2009/10/30/expressionmaximizer/" target="_blank">expression maximizer utility</a> a couple of months ago. This was actually a fun project for me to be able to join in the <a href="http://www.biztalkgurus.com/blogs/biztalk/archive/2009/10/28/got-a-great-biztalk-tip-or-trick-and-you-could-win-richard-seroter-s-soa-patterns-book.aspx" target="_blank">BizTalk tip contest on BizTalk gurus</a>. I must admit though that I use it in my day to day development work.</p>
<p>I’m very excited that Microsoft has a similar feature out of the box. I gives me the same feeling when they added the browse button next for file ports in the admin console in BizTalk 2006 <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p>
<p>The expression window is now a standard visual studio window. This means you can for example dock it into the right pane:</p>
<p><a href="http://biztalkmessages.files.wordpress.com/2010/04/image.png" target="_blank"><img style="display:inline;border-width:0;" title="image" src="http://biztalkmessages.files.wordpress.com/2010/04/image_thumb.png?w=260&#038;h=191" border="0" alt="image" width="260" height="191" /></a></p>
<p>But you can also use it in the normal way:</p>
<p><a href="http://biztalkmessages.files.wordpress.com/2010/04/image1.png" target="_blank"><img style="display:inline;border-width:0;" title="image" src="http://biztalkmessages.files.wordpress.com/2010/04/image_thumb1.png?w=260&#038;h=191" border="0" alt="image" width="260" height="191" /></a></p>
<p>and resize it:</p>
<p><a href="http://biztalkmessages.files.wordpress.com/2010/04/image15.png"><img style="display:inline;border:0;" title="image" src="http://biztalkmessages.files.wordpress.com/2010/04/image15_thumb.png?w=260&#038;h=190" border="0" alt="image" width="260" height="190" /></a></p>
<p><a href="http://biztalkmessages.files.wordpress.com/2010/04/image3.png" target="_blank"><img style="display:inline;border-width:0;" title="image" src="http://biztalkmessages.files.wordpress.com/2010/04/image_thumb3.png?w=260&#038;h=190" border="0" alt="image" width="260" height="190" /></a></p>
<p>Zooming in the window is also possible. Handy if you need to do a demo:</p>
<p><a href="http://biztalkmessages.files.wordpress.com/2010/04/image23.png"><img style="display:inline;border:0;" title="image" src="http://biztalkmessages.files.wordpress.com/2010/04/image23_thumb.png?w=260&#038;h=138" border="0" alt="image" width="260" height="138" /></a></p>
<p>Cool! Thank you Microsoft!</p>
<br /> Tagged: <a href='http://biztalkmessages.vansplunteren.net/tag/biztalk-2010/'>BizTalk 2010</a>, <a href='http://biztalkmessages.vansplunteren.net/tag/development/'>Development</a>, <a href='http://biztalkmessages.vansplunteren.net/tag/orchestrations/'>Orchestrations</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/biztalkmessages.wordpress.com/664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/biztalkmessages.wordpress.com/664/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/biztalkmessages.wordpress.com/664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/biztalkmessages.wordpress.com/664/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/biztalkmessages.wordpress.com/664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/biztalkmessages.wordpress.com/664/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/biztalkmessages.wordpress.com/664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/biztalkmessages.wordpress.com/664/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/biztalkmessages.wordpress.com/664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/biztalkmessages.wordpress.com/664/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/biztalkmessages.wordpress.com/664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/biztalkmessages.wordpress.com/664/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/biztalkmessages.wordpress.com/664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/biztalkmessages.wordpress.com/664/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biztalkmessages.vansplunteren.net&amp;blog=3912620&amp;post=664&amp;subd=biztalkmessages&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://biztalkmessages.vansplunteren.net/2010/04/08/orchestration-expression-window-sizeable-in-biztalk-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">biztalkmessages</media:title>
		</media:content>

		<media:content url="http://biztalkmessages.files.wordpress.com/2010/04/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://biztalkmessages.files.wordpress.com/2010/04/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://biztalkmessages.files.wordpress.com/2010/04/image15_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://biztalkmessages.files.wordpress.com/2010/04/image_thumb3.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://biztalkmessages.files.wordpress.com/2010/04/image23_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Untyped messages and Business Rules Engine (part 2)</title>
		<link>http://biztalkmessages.vansplunteren.net/2010/03/04/untyped-messages-and-business-rules-engine-part-2/</link>
		<comments>http://biztalkmessages.vansplunteren.net/2010/03/04/untyped-messages-and-business-rules-engine-part-2/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 11:14:41 +0000</pubDate>
		<dc:creator>Randal van Splunteren</dc:creator>
				<category><![CDATA[BizTalk]]></category>
		<category><![CDATA[Business Rules Engine]]></category>
		<category><![CDATA[Orchestrations]]></category>

		<guid isPermaLink="false">http://biztalkmessages.wordpress.com/?p=612</guid>
		<description><![CDATA[This is a follow up post to my previous post on this topic. The method described in that post doesn’t seem to work when the policy is called from an orchestration. For more background information see this blogpost. I this post I will use the exact same sample as in the previous post. These are [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biztalkmessages.vansplunteren.net&amp;blog=3912620&amp;post=612&amp;subd=biztalkmessages&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is a follow up post to <a href="http://biztalkmessages.vansplunteren.net/2009/12/22/untyped-messages-and-business-rules-engine/" target="_blank">my previous post on this topic</a>. The method described in that post doesn’t seem to work when the policy is called from an orchestration. For more background information see <a href="http://biztalkmessages.vansplunteren.net/2010/03/04/more-on-untyped-messages-and-business-rules-engine/" target="_blank">this blogpost</a>.</p>
<p>I this post I will use the exact same sample as in the previous post. These are the schemas used:</p>
<p><pre class="brush: xml; auto-links: false;">

&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;
&lt;xs:schema xmlns:b=&quot;http://schemas.microsoft.com/BizTalk/2003&quot;

xmlns=&quot;http://UntypedBRE.FirstSchema&quot;
targetNamespace='http://UntypedBRE.FirstSchema'

xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;
  &lt;xs:element name=&quot;FirstSchema&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element name=&quot;FirstName&quot; type=&quot;xs:string&quot; /&gt;
        &lt;xs:element name=&quot;LastName&quot; type=&quot;xs:string&quot; /&gt;
        &lt;xs:element name=&quot;IsJohn&quot; type=&quot;xs:string&quot; /&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
&lt;/xs:schema&gt;

</pre></p>
<p> </p>
<p><pre class="brush: xml; auto-links: false;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;
&lt;xs:schema xmlns:b=&quot;http://schemas.microsoft.com/BizTalk/2003&quot;
xmlns=&quot;http://UntypedBRE.SecondSchema&quot;
targetNamespace='http://UntypedBRE.SecondSchema'
xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;
  &lt;xs:element name=&quot;SecondSchema&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element name=&quot;FirstName&quot; type=&quot;xs:string&quot; /&gt;
        &lt;xs:element name=&quot;LastName&quot; type=&quot;xs:string&quot; /&gt;
        &lt;xs:element name=&quot;IsJohn&quot; type=&quot;xs:string&quot; /&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
&lt;/xs:schema&gt;
</pre></p>
<p> </p>
<p><pre class="brush: xml; auto-links: false;">

&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;
&lt;xs:schema xmlns:b=&quot;http://schemas.microsoft.com/BizTalk/2003&quot;

xmlns=&quot;http://UntypedBRE.ThirdSchema&quot;
targetNamespace='http://UntypedBRE.ThirdSchema'

xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;
  &lt;xs:element name=&quot;ThirdSchema&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element name=&quot;FirstName&quot; type=&quot;xs:string&quot; /&gt;
        &lt;xs:element name=&quot;LastName&quot; type=&quot;xs:string&quot; /&gt;
        &lt;xs:element name=&quot;IsJohn&quot; type=&quot;xs:string&quot; /&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
&lt;/xs:schema&gt;

</pre></p>
<p>In my sample policy I want to check the ‘FirstName’ element. If the value is equal to ‘John’ I want to fill the ‘IsJohn’ element with value ‘yes’. The policy (and single rule) should work for all the above schemas.</p>
<p>The problem is that mentioned schemas belong to a different namespace and have a different rood node, hence in BizTalk terms have a different message type. Because XML schemas facts in the BRE are by default tightly coupled to a specific schema the consequence is that those facts can only operate on a single type of message.</p>
<p>In order to make this generic you have to do the following:</p>
<p><strong><span style="text-decoration:underline;">1. Add one of the schemas to the Facts Explorer in the BRE</span></strong></p>
<p><a href="http://biztalkmessages.files.wordpress.com/2010/03/image.png" target="_blank"><img style="display:inline;border-width:0;" title="image" src="http://biztalkmessages.files.wordpress.com/2010/03/image_thumb.png?w=260&#038;h=230" border="0" alt="image" width="260" height="230" /></a></p>
<p><strong><span style="text-decoration:underline;">2. Make the schema general</span></strong></p>
<p>As you can see the Document Type resembles the type of the schema I added. To make this generic I change this value to ‘Microsoft.XLANGs.BaseTypes.Any’. This will make sure that if I use a fact from this schema in a rule it will not be typed to this schema but will be generic:</p>
<p><a href="http://biztalkmessages.files.wordpress.com/2010/03/image1.png" target="_blank"><img style="display:inline;border-width:0;" title="image" src="http://biztalkmessages.files.wordpress.com/2010/03/image_thumb1.png?w=260&#038;h=229" border="0" alt="image" width="260" height="229" /></a></p>
<p><strong><span style="text-decoration:underline;">3. Create the rule</span></strong></p>
<p>In this step I create the rule. The facts will be filled in later.</p>
<p><a href="http://biztalkmessages.files.wordpress.com/2010/03/image2.png" target="_blank"><img style="display:inline;border-width:0;" title="image" src="http://biztalkmessages.files.wordpress.com/2010/03/image_thumb2.png?w=260&#038;h=164" border="0" alt="image" width="260" height="164" /></a></p>
<p><strong><span style="text-decoration:underline;">4. Modify the XML facts</span></strong></p>
<p>In the rule I need to evaluate the ‘FirstName’ fact and optionally set the ‘IsJohn’ fact. Because I want this to work on all schemas I need to define the facts in a generic way. If I click on the ‘FirstName’ fact I can see the xpath statements that point to this fact in the property pane:</p>
<p><a href="http://biztalkmessages.files.wordpress.com/2010/03/image3.png" target="_blank"><img style="display:inline;border-width:0;" title="image" src="http://biztalkmessages.files.wordpress.com/2010/03/image_thumb3.png?w=260&#038;h=202" border="0" alt="image" width="260" height="202" /></a></p>
<p>The ‘Xpath Field’ and ‘Xpath Selector’ properties are directly referring to ‘FirstSchema’ root node and namespace. I change the values to make them generic also:</p>
<p><a href="http://biztalkmessages.files.wordpress.com/2010/03/image4.png" target="_blank"><img style="display:inline;border-width:0;" title="image" src="http://biztalkmessages.files.wordpress.com/2010/03/image_thumb4.png?w=260&#038;h=197" border="0" alt="image" width="260" height="197" /></a></p>
<p>Note that I’m using ‘self::node()’ here. I described this trick before <a href="http://biztalkmessages.vansplunteren.net/2008/06/11/updating-multiple-nodes-with-different-parents-and-hierarchical-levels-using-the-biztalk-bre/">here</a>.</p>
<p>Now the XML fact is no longer pointing to a specific namespace or root node. It just points to a ‘FirstName’ node somewhere in Xml message.</p>
<p>There are of course other possible values for ‘Xpath selector’ and ‘Xpath Field’ to solve this. It all depends on the schemas. If for example the facts you need all have the same parent node you can make the ‘Xpath selector’ select the parent node and the ‘Xpath Field’ select the ‘FirstName’ element.</p>
<p>I do the same for the fact I want to update in the action of the rule:</p>
<p><a href="http://biztalkmessages.files.wordpress.com/2010/03/image5.png" target="_blank"><img style="display:inline;border-width:0;" title="image" src="http://biztalkmessages.files.wordpress.com/2010/03/image_thumb5.png?w=260&#038;h=210" border="0" alt="image" width="260" height="210" /></a></p>
<p><strong><span style="text-decoration:underline;">5. Complete the rule by adding the facts</span></strong></p>
<p>Finally I can drag the XML facts from the Facts Explorer to my rule to complete the condition and create a new action. Like this:</p>
<p><a href="http://biztalkmessages.files.wordpress.com/2010/03/image6.png" target="_blank"><img style="display:inline;border-width:0;" title="image" src="http://biztalkmessages.files.wordpress.com/2010/03/image_thumb6.png?w=260&#038;h=115" border="0" alt="image" width="260" height="115" /></a></p>
<p>You can see that the both the condition and the action are not referring (anymore) to any specific schema  but instead to any schema that has ‘FirstName’  and ‘IsJohn’  elements.</p>
<p>Testing the rule with instances from two different schemas shows that this works:</p>
<p><a href="http://biztalkmessages.files.wordpress.com/2010/03/image7.png" target="_blank"><img style="display:inline;border:0;" title="image" src="http://biztalkmessages.files.wordpress.com/2010/03/image_thumb7.png?w=260&#038;h=125" border="0" alt="image" width="260" height="125" /></a></p>
<p><a href="http://biztalkmessages.files.wordpress.com/2010/03/image8.png" target="_blank"><img style="display:inline;border:0;" title="image" src="http://biztalkmessages.files.wordpress.com/2010/03/image_thumb8.png?w=260&#038;h=128" border="0" alt="image" width="260" height="128" /></a></p>
<p>One thing to note about this is that the way I changed the xpath statements for the Xml facts comes with a performance penalty. Using things like ‘//*…….’.  will make the engine go through the whole xml tree which is less efficient then using the original full xpath statement. So if performance is a strict requirement be careful using techniques like these.</p>
<p>Another thing is that I do not check for the existence of the nodes first. The policy will crash when an message is processed that does not contain on of the nodes used in the rule.</p>
<br /> Tagged: <a href='http://biztalkmessages.vansplunteren.net/tag/biztalk/'>BizTalk</a>, <a href='http://biztalkmessages.vansplunteren.net/tag/business-rules-engine/'>Business Rules Engine</a>, <a href='http://biztalkmessages.vansplunteren.net/tag/orchestrations/'>Orchestrations</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/biztalkmessages.wordpress.com/612/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/biztalkmessages.wordpress.com/612/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/biztalkmessages.wordpress.com/612/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/biztalkmessages.wordpress.com/612/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/biztalkmessages.wordpress.com/612/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/biztalkmessages.wordpress.com/612/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/biztalkmessages.wordpress.com/612/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/biztalkmessages.wordpress.com/612/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/biztalkmessages.wordpress.com/612/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/biztalkmessages.wordpress.com/612/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/biztalkmessages.wordpress.com/612/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/biztalkmessages.wordpress.com/612/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/biztalkmessages.wordpress.com/612/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/biztalkmessages.wordpress.com/612/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biztalkmessages.vansplunteren.net&amp;blog=3912620&amp;post=612&amp;subd=biztalkmessages&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://biztalkmessages.vansplunteren.net/2010/03/04/untyped-messages-and-business-rules-engine-part-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">biztalkmessages</media:title>
		</media:content>

		<media:content url="http://biztalkmessages.files.wordpress.com/2010/03/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://biztalkmessages.files.wordpress.com/2010/03/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://biztalkmessages.files.wordpress.com/2010/03/image_thumb2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://biztalkmessages.files.wordpress.com/2010/03/image_thumb3.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://biztalkmessages.files.wordpress.com/2010/03/image_thumb4.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://biztalkmessages.files.wordpress.com/2010/03/image_thumb5.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://biztalkmessages.files.wordpress.com/2010/03/image_thumb6.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://biztalkmessages.files.wordpress.com/2010/03/image_thumb7.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://biztalkmessages.files.wordpress.com/2010/03/image_thumb8.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>ExpressionMaximizer</title>
		<link>http://biztalkmessages.vansplunteren.net/2009/10/30/expressionmaximizer/</link>
		<comments>http://biztalkmessages.vansplunteren.net/2009/10/30/expressionmaximizer/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 15:16:15 +0000</pubDate>
		<dc:creator>Randal van Splunteren</dc:creator>
				<category><![CDATA[BizTalk]]></category>
		<category><![CDATA[BizTalk tools]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Orchestrations]]></category>

		<guid isPermaLink="false">http://biztalkmessages.wordpress.com/2009/10/30/expressionmaximizer/</guid>
		<description><![CDATA[A bigger expression shape window is a feature that almost always appears on “next version of BizTalk wish lists”. Every time Microsoft releases a new version of BizTalk we are all very disappointed that they did not make the expression window resizable or at least bigger. There are rumors that this is done to discourage [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biztalkmessages.vansplunteren.net&amp;blog=3912620&amp;post=479&amp;subd=biztalkmessages&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A bigger expression shape window is a feature that almost always appears on “<a href="http://geekswithblogs.net/LeonidGaneline/archive/2009/04/01/biztalk-what-features-we-would-like-to-see-in-future.aspx" target="_blank">next version of BizTalk wish lists</a>”.</p>
<p>Every time Microsoft releases a new version of BizTalk we are all very disappointed that they did not make the expression window resizable or at least bigger.</p>
<p>There are rumors that this is done to discourage developers to write a lot of code in those windows and move to external assemblies with helper classes instead.</p>
<p>Although I agree with that I still think it would be very nice to have a bigger window occasionally.</p>
<p>Like the “<a href="http://biztalkmessages.vansplunteren.net/2009/04/05/orchestration-variable-retriever-functoid-and-why-you-should-not-use-it/" target="_blank">Orchestration Variable Retriever Functoid</a>” this was on my “experimental things to do list” for a long time. I never had or took the chance to try it until BizTalk king <a href="http://www.biztalkgurus.com/blogs/biztalk/default.aspx" target="_blank">Stephen W. Thomas</a> announced <a href="http://www.biztalkgurus.com/blogs/biztalk/archive/2009/10/28/got-a-great-biztalk-tip-or-trick-and-you-could-win-richard-seroter-s-soa-patterns-book.aspx" target="_blank">his competition</a> for the best BizTalk tip or trick.</p>
<p>Of course I want to join this competition so I started coding. Now that it is finished I must admit it has become quite a hack but it seems to work <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p>
<p>Anyway the “ExpressionMaximizer” will be my entry for the competition.</p>
<p><strong><span style="text-decoration:underline;">A quick walkthrough:</span></strong></p>
<p>I have an orchestration with an expression shape containing a lot of code:</p>
<p><a href="http://biztalkmessages.files.wordpress.com/2009/10/orchestration.png" target="_blank"><img style="display:inline;border-width:0;" title="orchestration" src="http://biztalkmessages.files.wordpress.com/2009/10/orchestration_thumb.png?w=260&#038;h=131" border="0" alt="orchestration" width="260" height="131" /></a></p>
<p>I double click the expression shape to open it (in normal mode):</p>
<p><a href="http://biztalkmessages.files.wordpress.com/2009/10/normal_expressionwindow.png" target="_blank"><img style="display:inline;border-width:0;" title="normal_expressionwindow" src="http://biztalkmessages.files.wordpress.com/2009/10/normal_expressionwindow_thumb.png?w=260&#038;h=204" border="0" alt="normal_expressionwindow" width="260" height="204" /></a></p>
<p>With expression window still open I press CTRL+SHIFT+ALT+M (nice key combination <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ) and ……:</p>
<p><a href="http://biztalkmessages.files.wordpress.com/2009/10/maximized_expressionwindow.png" target="_blank"><img style="display:inline;border-width:0;" title="maximized_expressionwindow" src="http://biztalkmessages.files.wordpress.com/2009/10/maximized_expressionwindow_thumb.png?w=260&#038;h=204" border="0" alt="maximized_expressionwindow" width="260" height="204" /></a></p>
<p>I have a big expression window where I can type many long lines of code!!!!</p>
<p>Everything is back to normal when you close the window and open it again.</p>
<p>Note that you first have to open the expression shape before pressing the key combination.</p>
<p><span style="text-decoration:underline;"><strong>Want to try it yourself?<br />
</strong></span><span style="font-size:xx-small;">(description below is based on Visual Studio 2008)</span></p>
<p>- Download <a href="http://cid-2b880e94db699632.skydrive.live.com/self.aspx/ExpressionMaximizer/ExpressionMaximizer.zip" target="_blank">this zip file</a> and extract it somewhere.<br />
- Click ‘Tools’ –&gt; ‘External Tools…’<br />
- Press the &#8216;Add&#8217; button<br />
- Type a title, e.g. &#8216;Expression Window Maximizer&#8217;<br />
- Fill in the command text box by browsing to the extracted ‘ExpressionMaximizer.exe&#8217;</p>
<p><a href="http://biztalkmessages.files.wordpress.com/2009/10/externaltools.png" target="_blank"><img style="display:inline;border-width:0;" title="ExternalTools" src="http://biztalkmessages.files.wordpress.com/2009/10/externaltools_thumb.png?w=260&#038;h=257" border="0" alt="ExternalTools" width="260" height="257" /></a></p>
<p>- Press the &#8216;OK&#8217; button<br />
- Select ‘Tools’ –&gt; ‘Customize&#8230;’<br />
- Press the &#8216;Keyboard&#8230;&#8217; button<br />
- In the &#8216;Show commands containing:&#8217; text box type &#8216;Tools.External&#8217;<br />
- Select the correct &#8216;Tools.ExternalCommandX&#8217; from the list. <span style="font-size:xx-small;">(You need to find out the correct entry by counting the external tools in the Tools menu).</span><br />
- Click in the text box &#8216;Press shortcut keys:&#8217; to set the focus to it.<br />
- Press CTRL+ALT+SHIFT+M<br />
- Click the &#8216;Assign&#8217; button.</p>
<p><a href="http://biztalkmessages.files.wordpress.com/2009/10/customize.png" target="_blank"><img style="display:inline;border-width:0;" title="Customize" src="http://biztalkmessages.files.wordpress.com/2009/10/customize_thumb.png?w=260&#038;h=160" border="0" alt="Customize" width="260" height="160" /></a></p>
<p>- Press the &#8216;Ok&#8217; button.<br />
- Press the &#8216;Close&#8217; button.</p>
<p>I tried this on ‘Windows Server 2008 R2/VS2008&#8242; and ‘Windows Server 2003 R2/VS2005’ without problems but I still take no responsibility for malformed windows or other disasters <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  After all it is a big hack!</p>
<p>If you’re interested you can find the (VS2008) source code <a href="http://cid-2b880e94db699632.skydrive.live.com/self.aspx/ExpressionMaximizer/ExpressionMaximizer.Source.zip" target="_blank">here</a>.</p>
<br /> Tagged: BizTalk, BizTalk tools, Development, Orchestrations <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/biztalkmessages.wordpress.com/479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/biztalkmessages.wordpress.com/479/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/biztalkmessages.wordpress.com/479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/biztalkmessages.wordpress.com/479/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/biztalkmessages.wordpress.com/479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/biztalkmessages.wordpress.com/479/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/biztalkmessages.wordpress.com/479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/biztalkmessages.wordpress.com/479/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/biztalkmessages.wordpress.com/479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/biztalkmessages.wordpress.com/479/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/biztalkmessages.wordpress.com/479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/biztalkmessages.wordpress.com/479/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/biztalkmessages.wordpress.com/479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/biztalkmessages.wordpress.com/479/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biztalkmessages.vansplunteren.net&amp;blog=3912620&amp;post=479&amp;subd=biztalkmessages&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://biztalkmessages.vansplunteren.net/2009/10/30/expressionmaximizer/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">biztalkmessages</media:title>
		</media:content>

		<media:content url="http://biztalkmessages.files.wordpress.com/2009/10/orchestration_thumb.png" medium="image">
			<media:title type="html">orchestration</media:title>
		</media:content>

		<media:content url="http://biztalkmessages.files.wordpress.com/2009/10/normal_expressionwindow_thumb.png" medium="image">
			<media:title type="html">normal_expressionwindow</media:title>
		</media:content>

		<media:content url="http://biztalkmessages.files.wordpress.com/2009/10/maximized_expressionwindow_thumb.png" medium="image">
			<media:title type="html">maximized_expressionwindow</media:title>
		</media:content>

		<media:content url="http://biztalkmessages.files.wordpress.com/2009/10/externaltools_thumb.png" medium="image">
			<media:title type="html">ExternalTools</media:title>
		</media:content>

		<media:content url="http://biztalkmessages.files.wordpress.com/2009/10/customize_thumb.png" medium="image">
			<media:title type="html">Customize</media:title>
		</media:content>
	</item>
		<item>
		<title>Was promoted</title>
		<link>http://biztalkmessages.vansplunteren.net/2009/06/15/was-promoted/</link>
		<comments>http://biztalkmessages.vansplunteren.net/2009/06/15/was-promoted/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 15:00:26 +0000</pubDate>
		<dc:creator>Randal van Splunteren</dc:creator>
				<category><![CDATA[BizTalk]]></category>
		<category><![CDATA[Messaging]]></category>
		<category><![CDATA[Orchestrations]]></category>
		<category><![CDATA[Pipelines]]></category>

		<guid isPermaLink="false">http://biztalkmessages.vansplunteren.net/?p=406</guid>
		<description><![CDATA[Ever wanted to know in a send pipeline if a property was promoted before? The BizTalk API comes with an object called &#8216;ContextPropertyType&#8217; which you can use for this purpose. I have a very simple schema and corresponding instance: Above message travels through BizTalk using the following path: receive port -&#62; orchestration -&#62; send port [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biztalkmessages.vansplunteren.net&amp;blog=3912620&amp;post=406&amp;subd=biztalkmessages&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Ever wanted to know in a send pipeline if a property was promoted before? The BizTalk API comes with an object called &#8216;ContextPropertyType&#8217; which you can use for this purpose.</p>
<p>I have a very simple schema and corresponding instance:</p>
<p><img class="alignnone size-full wp-image-410" style="border:0;" title="waspromoted_schema" src="http://biztalkmessages.files.wordpress.com/2009/06/waspromoted_schema1.png?w=450" alt="waspromoted_schema"   /></p>
<p><img class="alignnone size-full wp-image-413" style="border:0;" title="waspromoted_schema_instance" src="http://biztalkmessages.files.wordpress.com/2009/06/waspromoted_schema_instance.png?w=450" alt="waspromoted_schema_instance"   /></p>
<p>Above message travels through BizTalk using the following path:</p>
<p>receive port -&gt; orchestration -&gt; send port</p>
<p>I defined the &#8216;Firstname&#8217; element as promoted property to have it promoted by the out-of-the-box XmlReceive pipeline. After that the message is sent to the message box and picked up by the orchestration to do some processing. Next the orchestration will send the message to the message box again using a send shape. Finally the send port picks up the message and sends it to some URI using an adapter.</p>
<p>In the send port I used a custom pipeline containing a pipeline component with this code:</p>
<p><a href="http://biztalkmessages.files.wordpress.com/2009/06/waspromoted_code1.png" target="_blank"><img class="alignnone size-thumbnail wp-image-419" style="border:0;" title="waspromoted_code" src="http://biztalkmessages.files.wordpress.com/2009/06/waspromoted_code1.png?w=400&#038;h=230" alt="waspromoted_code" width="400" height="230" /></a></p>
<p> After the message has been picked up by the send port the messaging engine will alter the context of the message. The &#8216;Firstname&#8217; element that was promoted before is not promoted anymore now. To prove this I call the IsPromoted method for the specific property (see code above).</p>
<p>So what if you want to know if the property was promoted before? This is where the ContextPropertyType object comes in. Together with the &#8216;GetPropertyType&#8217; method on the context object I&#8217;m able to find the status of the property.</p>
<p>Running this example shows the following output in DebugView:</p>
<p><a href="http://biztalkmessages.files.wordpress.com/2009/06/waspromoted_debug_view1.png" target="_blank"><img class="alignnone size-medium wp-image-422" style="border:0;" title="waspromoted_debug_view" src="http://biztalkmessages.files.wordpress.com/2009/06/waspromoted_debug_view1.png?w=300&#038;h=40" alt="waspromoted_debug_view" width="300" height="40" /></a></p>
<p> As you can see the PropertyType has a value equal to ContextPropertyType.WasPromoted. In the above sample I used an orchestration in the middle but the same will also apply to messaging only scenarios.</p>
<p>Although I recently made use of this API while implementing a very simple repair and resubmit feature, there might not be so many real world scenarios where one would use this. At least I couldn&#8217;t think of many. (Suggestion? Ping me, please.).  Also be aware that is an undocumented feature for which the BizTalk help states it is for internal use only. This basically means Microsoft will not guarantee any backward compatibility for this when new versions or SPs are released.</p>
<br /> Tagged: BizTalk, Messaging, Orchestrations, Pipelines <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/biztalkmessages.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/biztalkmessages.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/biztalkmessages.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/biztalkmessages.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/biztalkmessages.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/biztalkmessages.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/biztalkmessages.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/biztalkmessages.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/biztalkmessages.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/biztalkmessages.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/biztalkmessages.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/biztalkmessages.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/biztalkmessages.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/biztalkmessages.wordpress.com/406/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biztalkmessages.vansplunteren.net&amp;blog=3912620&amp;post=406&amp;subd=biztalkmessages&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://biztalkmessages.vansplunteren.net/2009/06/15/was-promoted/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">biztalkmessages</media:title>
		</media:content>

		<media:content url="http://biztalkmessages.files.wordpress.com/2009/06/waspromoted_schema1.png" medium="image">
			<media:title type="html">waspromoted_schema</media:title>
		</media:content>

		<media:content url="http://biztalkmessages.files.wordpress.com/2009/06/waspromoted_schema_instance.png" medium="image">
			<media:title type="html">waspromoted_schema_instance</media:title>
		</media:content>

		<media:content url="http://biztalkmessages.files.wordpress.com/2009/06/waspromoted_code1.png?w=150" medium="image">
			<media:title type="html">waspromoted_code</media:title>
		</media:content>

		<media:content url="http://biztalkmessages.files.wordpress.com/2009/06/waspromoted_debug_view1.png?w=300" medium="image">
			<media:title type="html">waspromoted_debug_view</media:title>
		</media:content>
	</item>
		<item>
		<title>Orchestration variable retriever functoid (and why you should not use it)</title>
		<link>http://biztalkmessages.vansplunteren.net/2009/04/05/orchestration-variable-retriever-functoid-and-why-you-should-not-use-it/</link>
		<comments>http://biztalkmessages.vansplunteren.net/2009/04/05/orchestration-variable-retriever-functoid-and-why-you-should-not-use-it/#comments</comments>
		<pubDate>Sun, 05 Apr 2009 20:22:15 +0000</pubDate>
		<dc:creator>Randal van Splunteren</dc:creator>
				<category><![CDATA[BizTalk]]></category>
		<category><![CDATA[Functoid]]></category>
		<category><![CDATA[Map]]></category>
		<category><![CDATA[Orchestrations]]></category>

		<guid isPermaLink="false">http://biztalkmessages.wordpress.com/?p=342</guid>
		<description><![CDATA[This week I spend some time on writing a functoid that retrieves the value of a variable in an orchestration. Lets take a look on the functoid&#8217;s usage first. Usage This is the declaration of a string variable &#8216;lastName&#8217; in a very simple test orchestration: This is the expression shape where the value of that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biztalkmessages.vansplunteren.net&amp;blog=3912620&amp;post=342&amp;subd=biztalkmessages&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This week I spend some time on writing a functoid that retrieves the value of a variable in an orchestration. Lets take a look on the functoid&#8217;s usage first.</p>
<p><strong><span style="text-decoration:underline;">Usage</span></strong></p>
<p>This is the declaration of a string variable &#8216;lastName&#8217; in a very simple test orchestration:</p>
<p><a href="http://biztalkmessages.files.wordpress.com/2009/04/image.png"><img style="border-bottom:0;border-left:0;border-top:0;border-right:0;" src="http://biztalkmessages.files.wordpress.com/2009/04/image-thumb.png?w=222&#038;h=260" border="0" alt="image" width="222" height="260" /></a></p>
<p>This is the expression shape where the value of that variable is set to my last name:</p>
<p><a href="http://biztalkmessages.files.wordpress.com/2009/04/image1.png"><img style="border-bottom:0;border-left:0;border-top:0;border-right:0;" src="http://biztalkmessages.files.wordpress.com/2009/04/image-thumb1.png?w=260&#038;h=121" border="0" alt="image" width="260" height="121" /></a></p>
<p>This is the map that is executed using a transform shape right after the expression shape above. The map contains the variable retriever functoid. It has one parameter that takes the name of the variable to fetch.</p>
<p>Please pay special attention to the icon because that bloody thing took me 50% of the development time. The result shows why I try to stay away from UI development as much as possible. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><a href="http://biztalkmessages.files.wordpress.com/2009/04/image2.png"><img style="border-bottom:0;border-left:0;border-top:0;border-right:0;" src="http://biztalkmessages.files.wordpress.com/2009/04/image-thumb2.png?w=260&#038;h=151" border="0" alt="image" width="260" height="151" /></a></p>
<p>Finally this is the Xml message returned from the orchestration via the file adapter.</p>
<p><a href="http://biztalkmessages.files.wordpress.com/2009/04/image3.png"><img style="border-bottom:0;border-left:0;border-top:0;border-right:0;" src="http://biztalkmessages.files.wordpress.com/2009/04/image-thumb3.png?w=260&#038;h=56" border="0" alt="image" width="260" height="56" /></a></p>
<p><strong><span style="text-decoration:underline;">Disadvantages</span></strong></p>
<p>At first I was a little excited that I got this working. I did some testing with different orchestrations and it seems to work OK. After a while (and thinking this over) my excitement was tempered because I think the functoid has three big disadvantages:</p>
<ol>
<li>Although questions related to this popup regularly in the BizTalk newsgroups I could not think of any real world examples. The sample above could also be implemented by using a message assignment shape after the map. In the message assignment shape the value of the variable can be assigned using xpath, properties or distinguished fields. The only way the functoid can be useful is when you need an orchestration variable value in a map to do some processing while the actual value is not mapped to the destination schema. But then again there are other ways to implement that. (Using a helper message and a multi message map). </li>
<li> The functoid code contains a considerable amount of reflection code. I didn&#8217;t do any performance tests but it is obvious that reflection comes with a cost. So in terms of performance it will probably be much better  to use alternative methods.</li>
<li> This is probably not supported by MS. Mainly because it uses XLANG code which is normally hidden from the developers. </li>
</ol>
<p>These disadvantages make me conclude that this functoid is not very useful in real world scenarios. I really want to know what others think about this. So whether you agree or don&#8217;t agree please share your thoughts on this!</p>
<p><strong><span style="text-decoration:underline;">The other way around</span></strong></p>
<p>Now that I figured out a way to access a variable it is a small step to take this a little further and build a functoid that WRITES the value of a variable in an orchestration. I didn&#8217;t implement such a functoid because of above mentioned points. I also think writing, as opposed to, reading is very tricky because you need to take things like serialization and locking into account.</p>
<p>If your still not convinced that you should <strong>not </strong>use this you can download the functoid &#8220;dll&#8221; from <a href="http://cid-2b880e94db699632.skydrive.live.com/self.aspx/Sample.OrchVarRetrieverFunctoid/OrchVarRetrieverFunctoid.dll" target="_blank">here</a>.</p>
<p><strong><span style="text-decoration:underline;">Installation instructions:</span></strong></p>
<ul>
<li>copy the .dll to the &#8216;Mapper Extensions&#8217; folder which resides in the BizTalk installation folder.</li>
<li>put the .dll in the gac.</li>
<li>Open a map in Visual Studio, click right in the toolbox area and choose the functoids tab.</li>
<li>Browse the the functoid dll in the &#8216;Mapper Extensions&#8217; folder to add it to the toolbox.</li>
</ul>
<p>The source is also available <a href="http://cid-2b880e94db699632.skydrive.live.com/self.aspx/Sample.OrchVarRetrieverFunctoid/OrchVarRetrieverFunctoid.zip" target="_blank">here</a>. It is build using BizTalk 2006 R2.</p>
<br /> Tagged: BizTalk, Functoid, Map, Orchestrations <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/biztalkmessages.wordpress.com/342/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/biztalkmessages.wordpress.com/342/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/biztalkmessages.wordpress.com/342/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/biztalkmessages.wordpress.com/342/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/biztalkmessages.wordpress.com/342/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/biztalkmessages.wordpress.com/342/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/biztalkmessages.wordpress.com/342/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/biztalkmessages.wordpress.com/342/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/biztalkmessages.wordpress.com/342/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/biztalkmessages.wordpress.com/342/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/biztalkmessages.wordpress.com/342/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/biztalkmessages.wordpress.com/342/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/biztalkmessages.wordpress.com/342/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/biztalkmessages.wordpress.com/342/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biztalkmessages.vansplunteren.net&amp;blog=3912620&amp;post=342&amp;subd=biztalkmessages&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://biztalkmessages.vansplunteren.net/2009/04/05/orchestration-variable-retriever-functoid-and-why-you-should-not-use-it/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">biztalkmessages</media:title>
		</media:content>

		<media:content url="http://biztalkmessages.files.wordpress.com/2009/04/image-thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://biztalkmessages.files.wordpress.com/2009/04/image-thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://biztalkmessages.files.wordpress.com/2009/04/image-thumb2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://biztalkmessages.files.wordpress.com/2009/04/image-thumb3.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Message creation</title>
		<link>http://biztalkmessages.vansplunteren.net/2008/10/13/message-creation/</link>
		<comments>http://biztalkmessages.vansplunteren.net/2008/10/13/message-creation/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 07:16:18 +0000</pubDate>
		<dc:creator>Randal van Splunteren</dc:creator>
				<category><![CDATA[BizTalk]]></category>
		<category><![CDATA[Orchestrations]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://biztalkmessages.wordpress.com/?p=42</guid>
		<description><![CDATA[In March Yossi Dahan blogged about various ways to create messages from scratch in an orchestration. In his post (in the comments) he also mentioned he would be very interested in the performance characteristics. I shared this interest with him an decided to spend some time on a small test solution to measure the performance. Because I wanted to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biztalkmessages.vansplunteren.net&amp;blog=3912620&amp;post=42&amp;subd=biztalkmessages&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In March <a title="Yossi Dahan" href="http://www.sabratech.co.uk/blogs/yossidahan/" target="_blank">Yossi Dahan</a> blogged about <a href="http://www.sabratech.co.uk/blogs/yossidahan/2008/03/creating-message-from-scratch.html" target="_blank">various ways to create messages from scratch</a> in an orchestration. In his post (in the comments) he also mentioned he would be very interested in the performance characteristics.</p>
<p>I shared this interest with him an decided to spend some time on a small test solution to measure the performance. Because I wanted to be sure about my results (and also because this was his blog subject <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> ) I asked the real expert (Yossi) to validate my results.</p>
<p>With a (little delay <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ) Yossi posted about the <a href="http://www.sabratech.co.uk/blogs/yossidahan/2008/10/fun-with-message-creation-in-biztalk.html" target="_blank">results</a>.</p>
<p>Thanks Yossi.</p>
<br /> Tagged: BizTalk, Orchestrations, Performance <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/biztalkmessages.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/biztalkmessages.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/biztalkmessages.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/biztalkmessages.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/biztalkmessages.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/biztalkmessages.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/biztalkmessages.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/biztalkmessages.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/biztalkmessages.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/biztalkmessages.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/biztalkmessages.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/biztalkmessages.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/biztalkmessages.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/biztalkmessages.wordpress.com/42/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biztalkmessages.vansplunteren.net&amp;blog=3912620&amp;post=42&amp;subd=biztalkmessages&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://biztalkmessages.vansplunteren.net/2008/10/13/message-creation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">biztalkmessages</media:title>
		</media:content>
	</item>
		<item>
		<title>Call Rules Shape, Atomic Transactions and the Orchestration Designer</title>
		<link>http://biztalkmessages.vansplunteren.net/2008/06/13/call-rules-shape-atomic-transactions-and-the-orchestration-designer/</link>
		<comments>http://biztalkmessages.vansplunteren.net/2008/06/13/call-rules-shape-atomic-transactions-and-the-orchestration-designer/#comments</comments>
		<pubDate>Fri, 13 Jun 2008 06:25:08 +0000</pubDate>
		<dc:creator>Randal van Splunteren</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[BizTalk]]></category>
		<category><![CDATA[Orchestrations]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://biztalkmessages.wordpress.com/?p=16</guid>
		<description><![CDATA[One of the nice improvements in BizTalk 2006 R1 (BTS2k6R1) and higher is that you don’t need to use an atomic transaction scope around the “Call Rules” shape. I guess the reason for this is that classes used internally by the Business Rules Engine are now serializable while they were not in previous release.   [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biztalkmessages.vansplunteren.net&amp;blog=3912620&amp;post=16&amp;subd=biztalkmessages&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div><a href="http://biztalkmessages.files.wordpress.com/2008/06/orchestration-designer-context-menu.jpg"></a>One of the nice improvements in BizTalk 2006 R1 (BTS2k6R1) and higher is that you don’t need to use an atomic transaction scope around the “Call Rules” shape. I guess the reason for this is that classes used internally by the Business Rules Engine are now serializable while they were not in previous release.</div>
<div> </div>
<div>Recently the orchestration designer in Visual Studio almost got me. I wanted to use a “Call Rules” shape en saw to my surprise that the shape was grayed out in the shape context menu. This is menu you get when you right click somewhere in the orchestration designer surface.</div>
<div><img class="aligncenter size-full wp-image-17" src="http://biztalkmessages.files.wordpress.com/2008/06/orchestration-designer-context-menu.jpg?w=450" alt=""   /></div>
<div>What was going on here? Was I wrong? Was it wishful thinking? Did this new feature only exist in my head? Do I still have to use the atomic transaction scope in my orchestrations? Because Visual Studio is always right and I’m always wrong I was about to add the scope to my orchestration.</div>
<div> </div>
<div>Because I still felt a little bit disappointed I decided to have a quick look in the BTS2k6r1 help file. Nothing special was mentioned in the topic “How to Use the Call Rules Shape” however. Still curious I also looked at the same topic in the BTS2k6r2 help file. To my surprise the topic is updated and contains the following note:  </div>
<div> </div>
<div><em>In BizTalk Server 2004, you can insert a Call Rules shape within an orchestration or a Scope shape with Transaction Type set to Atomic. In BizTalk Server 2006, you do not need to have an atomic scope to insert a Call Rules shape. You can drag a Call Rules shape into the Orchestration Design Surface from the Toolbox. However, in BizTalk Server 2006, the Call Rules menu item is disabled in the context menu if you try to insert a Call Rules shape inside an orchestration that does not have an atomic scope. This is a limitation with the BizTalk Server 2006 product.</em></div>
<div><em></em> </div>
<div>So I was right! You don’t have to use an atomic transaction scope anymore. Apparently there is a bug in the orchestration designer. You can only drag a call rules shape from the toolbox to the orchestration designer surface. The same option can only be used from the context menu if you are inside a scope.</div>
<div> </div>
<div>I really wonder what the reason for this is? Is it just a bug? And why didn’t they solve this in BTS2k6r2? And also will it be solved in the coming R3.</div>
<div> </div>
<div>Anyway what point do I want to make here? </div>
<ul>
<li>Visual Studio is not always right. In rare cases you’re right and Visual Studio is not! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
<li>You don’t have to use an atomic transaction scope anymore when you want to use the “Call Rules” shape.</li>
</ul>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/biztalkmessages.wordpress.com/16/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/biztalkmessages.wordpress.com/16/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/biztalkmessages.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/biztalkmessages.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/biztalkmessages.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/biztalkmessages.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/biztalkmessages.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/biztalkmessages.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/biztalkmessages.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/biztalkmessages.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/biztalkmessages.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/biztalkmessages.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/biztalkmessages.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/biztalkmessages.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/biztalkmessages.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/biztalkmessages.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biztalkmessages.vansplunteren.net&amp;blog=3912620&amp;post=16&amp;subd=biztalkmessages&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://biztalkmessages.vansplunteren.net/2008/06/13/call-rules-shape-atomic-transactions-and-the-orchestration-designer/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">biztalkmessages</media:title>
		</media:content>

		<media:content url="http://biztalkmessages.files.wordpress.com/2008/06/orchestration-designer-context-menu.jpg" medium="image" />
	</item>
	</channel>
</rss>
