<?xml version="1.0" encoding="utf-8"?>
<feed xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom">
  <title>Scott's Breeze Blog - RFID, BizTalk </title>
  <link rel="alternate" type="text/html" href="http://blogs.breezetraining.com.au/scotts/" />
  <link rel="self" href="http://blogs.breezetraining.com.au/scotts/SyndicationService.asmx/GetAtom" />
  <icon>favicon.ico</icon>
  <updated>2008-11-11T17:22:17.8617528-08:00</updated>
  <author>
    <name>Breeze Training</name>
  </author>
  <subtitle>...and everything in between</subtitle>
  <id>http://blogs.breezetraining.com.au/scotts/</id>
  <generator uri="http://www.dasblog.net" version="1.8.5223.2">DasBlog</generator>
  <entry>
    <title>Kane Theory</title>
    <link rel="alternate" type="text/html" href="http://blogs.breezetraining.com.au/scotts/2008/11/12/KaneTheory.aspx" />
    <id>http://blogs.breezetraining.com.au/scotts/PermaLink,guid,d8f1597a-5701-49ad-9ef9-1d4cb2754d42.aspx</id>
    <published>2008-11-11T16:47:01.779464-08:00</published>
    <updated>2008-11-11T17:22:17.8617528-08:00</updated>
    <category term="BizTalk General" label="BizTalk General" scheme="dasBlog" />
    <category term="Humour" label="Humour" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Putting together BizTalk integration solutions can be complex and tricky at times.
      Debugging them is an art in itself. While onsite recently, I found myself (on more
      than one occasion) having *words* with BizTalk.
   </p>
        <p>
      One example that tested our relationship (BizTalk and I) was an orchestration decision
      shape that appeared to be misbehaving. I had three branches in the decision shape,
      each branch testing the existence of a node in the message being processed using the
      xpath() function. For Example:
   </p>
        <blockquote>
          <p>
            <em>xpath(msgRequest, "string(count(/*[local-name()='root']/*[local-name()='parent']/*[local-name()='child'
      and code='some value']))") == "0"</em>
          </p>
        </blockquote>
        <blockquote>
          <p>
            <em>
              <strong>Tip</strong>: use </em>
            <a href="http://www.bizbert.com/bizbert/2007/11/25/DanSharp+XmlViewer.aspx" target="_blank">
              <em>Dan
      Sharp's Xml Viewer</em>
            </a>
            <em> to retrieve the correct xpath to use in these statements.
      BizTalk schemas will give you them to, but Dan's tool has some nice features thrown
      into the bargain <img alt="smile_wink" src="http://spaces.live.com/rte/emoticons/smile_wink.gif" /></em>
          </p>
        </blockquote>
        <p>
      One branch rule tested for a zero node count, another for exactly one, and the Else
      rule branch to handle multiple occurrences of the node. During testing and debugging
      we found the else branch was always being used despite the messages satisfying one
      of the other rule conditions (over different tests). Repeated checks, breakpoints,
      and logging soaked up 20 minutes or more and had me demanding satisfaction by challenging
      BizTalk to a duel with pistols at dawn. <img alt="smile_angry" src="http://spaces.live.com/rte/emoticons/smile_angry.gif" /></p>
        <p>
      It was then, a bright beam of light breached the false ceiling above me and shone
      down in all is splendour. No, this was not a helping hand from god, but rather from
      a colleague working with me. Picking up on my frustrations, he calmly stood, moved
      over to me, and placing a soothing hand on my shoulder, utters two words that have
      changed my life...<strong>Kane Theory</strong>. I eagerly implemented a quick change
      (as guided by Kane Theory teachings) and my problem was solved! More cases arose during
      the project and each of them resolved with ease using this mystic and elegant theory.
   </p>
        <p>
      Ok. That's a bit dramatic, but I am considering a professional self-help book exploring
      the practical uses of Kane Theory and wanted to get some practice in.
   </p>
        <p>
          <u>So what is <strong>Kane Theory</strong>?</u>
        </p>
        <p>
      Although only a novice in its teachings, I am fortunate to receive guidance from the
      enlighten one himself. Kane Adams (his real name used here to <strike>protect</strike> reveal
      his identity)  explains it in terms of Yin &amp; Yang, Karma, and the Force.
      Reflecting on this I can best describe it as a derivative of keep it simple stupid
      (KISS).
   </p>
        <p>
      In the example above, we declared an orchestration variable (System.String) to store
      the result of the xpath function in an Expression shape before entering the Decision
      shape. We then used the variable in the rule expression for the comparison. Eg:
   </p>
        <blockquote>
          <p>
            <em>strNodeCount == "0"</em>
          </p>
        </blockquote>
        <p>
      By powers understood only to the enlighten one, this worked a treat and we could all
      break for a quick cup of the worst coffee ever brewed. (Sceptics might argue that
      it has to do with the way the XLANG engine performs explicit type conversions during
      the comparison operation...but they would say that wouldn't they!)
   </p>
        <p>
      As for the enlighten one himself:
   </p>
        <p>
          <strong>Some say</strong> he is a direct descent of John Adams, author of the mystical
      theory of political architecture and founding father of the new Empire (there's the
      link to the Force we needed).<br /><strong>Some say</strong>, he meditates to the haunting chants of mid-level public
      servants.<br />
      We know him as <strong>The Stig</strong>!
   </p>
        <p>
          <a href="http://www.breezetraining.com.au/blogs/scotts/content/binary/KaneTheory_A316/thestig.jpg">
            <img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="109" alt="Author of the enlighted" src="http://www.breezetraining.com.au/blogs/scotts/content/binary/KaneTheory_A316/thestig_thumb.jpg" width="109" border="0" />
          </a>
        </p>
        <img width="0" height="0" src="http://blogs.breezetraining.com.au/scotts/aggbug.ashx?id=d8f1597a-5701-49ad-9ef9-1d4cb2754d42" />
      </div>
    </content>
  </entry>
  <entry>
    <title>WCF LOB Adapter for Oracle on 64-bit OS</title>
    <link rel="alternate" type="text/html" href="http://blogs.breezetraining.com.au/scotts/2008/09/22/WCFLOBAdapterForOracleOn64bitOS.aspx" />
    <id>http://blogs.breezetraining.com.au/scotts/PermaLink,guid,1d53295f-f342-4e66-a33e-162ddb23aa51.aspx</id>
    <published>2008-09-22T06:31:09.9437879-07:00</published>
    <updated>2008-09-22T06:31:09.9437879-07:00</updated>
    <category term="BizTalk General" label="BizTalk General" scheme="dasBlog" />
    <category term="WCF LOB Adapters" label="WCF LOB Adapters" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Had a strange error appear last week when using the WCF LOB Adapter for Oracle and
      spent an hour of my life I will never get back. When attempting to connect to an Oracle
      DB we kept getting the following error:
   </p>
        <blockquote>
          <p>
            <em>ORA-12154: TNS:could not resolve the connect identifier specified</em>
          </p>
        </blockquote>
        <p>
      This occurred when we:
   </p>
        <ol>
          <li>
         Tried to generate metadata in our BizTalk project using the Add Generated Items wizard.</li>
          <li>
         Tried to generate metadata in a Class Library project using the Add Adapter Service
         Reference wizard.</li>
          <li>
         Connect to an Oracle DB using the Oracle Explorer.</li>
        </ol>
        <p>
      We had all the latest versions/patches of the Oracle client and WCF LOB Adapter (Oh,
      yeah. Thanks Oracle for packaging patches in easy to consume 1GB downloads...love
      your work!!)
   </p>
        <p>
      We could however, connect to Oracle using the Oracle SQL Developer Tool. So we knew
      something was happening (or not happening inside of VS).
   </p>
        <p>
      It turns out the issue relates to the install directory of VS2005. In our case it
      was 
   </p>
        <blockquote>
          <p>
            <em>C:\Program Files (x86)\...</em>
          </p>
        </blockquote>
        <p>
      This triggers an *undocumented feature* in the Oracle Data Provider for .Net (ODP.NET)
      so that applications with a parenthesis in their (exe) path fail to connect to the
      server.
   </p>
        <p>
      The solution was to uninstall VS2005 and reinstall using a different install directory
      *one that did not have (x86) in it*.
   </p>
        <p>
          <img alt="smile_confused" src="http://spaces.live.com/rte/emoticons/smile_confused.gif" /> ...
      I know, I did not want to believe it either, but if you want to save yourself time
      and hair try this solution first.
   </p>
        <img width="0" height="0" src="http://blogs.breezetraining.com.au/scotts/aggbug.ashx?id=1d53295f-f342-4e66-a33e-162ddb23aa51" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Testing BizTalk RFID Processes</title>
    <link rel="alternate" type="text/html" href="http://blogs.breezetraining.com.au/scotts/2008/07/17/TestingBizTalkRFIDProcesses.aspx" />
    <id>http://blogs.breezetraining.com.au/scotts/PermaLink,guid,dc47ccf7-4577-4f56-ace3-ad02ae634a1f.aspx</id>
    <published>2008-07-17T06:23:12.194375-07:00</published>
    <updated>2008-07-17T06:24:24.225625-07:00</updated>
    <category term="BizTalk RFID" label="BizTalk RFID" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
        </p>
        <p>
      When developing applications, at some point in the dev cycle we want to know how the
      system will perform under load. In BizTalk RFID land it is no different. In fact,
      in BizTalk RFID implementations we often deal with devices capable of raising hundreds
      of reads every second. So how do we go about testing these?
   </p>
        <p>
      I'm a big fan of using physical devices during development rather than device emulation,
      but when it comes to load testing we need to present hundreds of tags to the reader
      and no matter what I try I just can't get the work experience kid to act fast enough!
      But instead of using a emulated device, what if we could raise tag read events programmatically
      and have our RFID Process consume them? Surely then we could get enough events to
      constitute a decent load test.
   </p>
        <p>
      So how do we go about pushing tag read events through our RFID process in code?
   </p>
        <p>
      We do this using the BizTalk RFID management API's, namely the <a href="http://msdn.microsoft.com/en-us/library/microsoft.sensorservices.rfid.management.processmanagerproxy.aspx" target="_blank">ProcessManagerProxy</a>.
      In just a few lines of code we can connect to the RFID process we want to test and
      "submit" a tag read event to the event pipeline. To get up and running with this you
      will need to add the following references to your project: (all can be found in %RFIDINSTALLDIR%\bin)
   </p>
        <ul>
          <li>
         Microsoft.Rfid.Design.dll</li>
          <li>
         Microsoft.Rfid.ManagementWebServiceProxies.dll</li>
          <li>
         Microsoft.Rfid.SpiSdk.dll</li>
          <li>
         Microsoft.Rfid.Util.dll</li>
        </ul>
        <p>
      Then, in three lines of code you can create your tag read event, connect to your process,
      and submit your event for processing;
   </p>
        <blockquote>
          <pre class="csharpcode">
            <span class="rem">// Create the tag read event
   to submit</span>
            <font color="#008080">TagReadEvent</font> tag = <span class="kwrd">new</span><font color="#008080">TagReadEvent</font>( <font color="#008080">HexUtilities</font>.HexDecode(strTagID), <font color="#008080">TagType</font>.EpcClass1Gen2, <font color="#008080">HexUtilities</font>.HexDecode(strTagData),
   strTagSource, <font color="#008080">DateTime</font>.Now, <span class="kwrd">null</span>, <span class="kwrd">null</span> ); <span class="rem">//
   Connect to the local RFID server</span><font color="#008080">ProcessManagerProxy</font> proxy
   = <span class="kwrd">new</span><font color="#008080">ProcessManagerProxy</font>(<span class="str">"localhost"</span>); <span class="rem">//
   Submit event to the event pipeline</span> proxy.AddEventToProcessPipeline( strRfidProcessName,
   tag, strLogicalDeviceName); </pre>
          <style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
        </blockquote>
        <p>
      And that's it.
   </p>
        <p>
      For my needs, I created a quick Win forms app that retrieved a list of registered
      tag id's from a SQL DB and submitted them to my RFID process at configured intervals:
   </p>
        <p>
          <a href="http://www.breezetraining.com.au/blogs/scotts/content/binary/TestingBizTalkRFIDProcesses_FC9D/rfidprocesstester.png">
            <img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="174" alt="rfid process tester" src="http://www.breezetraining.com.au/blogs/scotts/content/binary/TestingBizTalkRFIDProcesses_FC9D/rfidprocesstester_thumb.png" width="632" border="0" />
          </a>
        </p>
        <p>
      I added a few variables to adjust the interval between tag read events, the number
      of events to submit each interval, and the number of duplicates to send for each tag
      id. These variables (used when looping through the set of tag id's) combine to give
      me a good approximation to a real, high volume environment.
   </p>
        <p>
      Firing up good old <em>perfmon</em> and adding the <em>RFID:Process</em> counters,
      I ran through a number of test configurations to make sure my RFID process performs
      well under high load. (Note: the RFID process you are monitoring must be running before
      you can add the counters). Of most interest is the <em>Tags In Queue</em> counter.
      This tells me when my process is not performing well and tags are being queued up
      waiting to be processed (not good in real-time processing systems). We want this to
      be flat-lined most of the time.
   </p>
        <p>
          <a href="http://www.breezetraining.com.au/blogs/scotts/content/binary/TestingBizTalkRFIDProcesses_FC9D/perfmon.png">
            <img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="332" alt="perfmon" src="http://www.breezetraining.com.au/blogs/scotts/content/binary/TestingBizTalkRFIDProcesses_FC9D/perfmon_thumb.png" width="628" border="0" />
          </a>
        </p>
        <p>
      Another good idea is to use the SQL Sink EH component while testing. After running
      your tests you can simply and easily calculate event processing latency by executing
      the following T-SQL query against the <em>tagevents</em> table in the <em>RfidSink</em> DB.
   </p>
        <blockquote>
          <pre class="csharpcode">
            <span class="kwrd">SELECT</span>
            <span class="kwrd">
              <font color="#ff00ff">AVG</font>
            </span>(<font color="#ff00ff">DATEDIFF</font>(ms,
   sinktime, tagtime)) <span class="kwrd">FROM</span> tagevents;</pre>
          <style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
        </blockquote>
        <p>
      A while back, <a href="http://blogs.breezetraining.com.au/mickb/" target="_blank">Mick</a><a href="http://blogs.breezetraining.com.au/mickb/2008/05/21/BizTalkRFIDHowToClusteringForHighAvailability.aspx" target="_blank">posted</a> about
      a great article on MSDN around performance and capacity planning for BizTalk RFID.
      Some goodness in that article so check it out as well.
   </p>
        <img width="0" height="0" src="http://blogs.breezetraining.com.au/scotts/aggbug.ashx?id=dc47ccf7-4577-4f56-ace3-ad02ae634a1f" />
      </div>
    </content>
  </entry>
  <entry>
    <title>The Great Phone Fry-up Swindle</title>
    <link rel="alternate" type="text/html" href="http://blogs.breezetraining.com.au/scotts/2008/06/30/TheGreatPhoneFryupSwindle.aspx" />
    <id>http://blogs.breezetraining.com.au/scotts/PermaLink,guid,6c1561dd-81b6-461b-aafc-67bad10ddde3.aspx</id>
    <published>2008-06-29T22:11:19.9825-07:00</published>
    <updated>2008-06-29T22:11:19.9825-07:00</updated>
    <category term="Humour" label="Humour" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Ever seen some of those videos of mobile phones frying popcorn? Mick <a href="http://blogs.breezetraining.com.au/mickb/2008/06/26/MobilePhoneseverNeedAQuickFryUp.aspx" target="_blank">posted</a> some
      a few days ago and my wife and I thought we could use a snack while we watched a movie
      last night.
   </p>
        <p>
      We tried to "cook" a small number of popcorn kernels using two Sony Eriksson K610i's,
      a connected Bluetooth headset, and an old Motorola E386 (similar setup to that in
      the videos from Mick). The K610's have a SAR rating of 1.01 (as reported on the <a href="http://www.sarshield.com/english/radiationchart-sonyericsson.htm" target="_blank">SAR
      Shield web site</a>)
   </p>
        <p>
      The result...we went hungry. And we did leave the calls open for a minute or two,
      stopped and started calls, even sent picture messages from one handset to the next.
      I don't think they emit nearly enough RF to pop the kernels. It takes the microwave
      (895W) a few minutes to do the job, we would have to have the phones (~0.7W) in talk/data
      mode for over a day to get close to that amount.
   </p>
        <p>
      20 minutes wasted. Luckily we have one of those mobile plans were we get free calls
      between our phones.
   </p>
        <p>
      That got me thinking....we need more power.
   </p>
        <p>
          <a href="http://www.breezetraining.com.au/blogs/scotts/content/binary/TheGreatPhoneFryupSwindle_9337/DSC00525.jpg">
            <img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="184" alt="DSC00525" src="http://www.breezetraining.com.au/blogs/scotts/content/binary/TheGreatPhoneFryupSwindle_9337/DSC00525_thumb.jpg" width="244" border="0" />
          </a>
        </p>
        <p>
      So I hooked up three UHF long range RFID antennas and placed some rather nervous looking
      kernels in the middle. At 2W each, it still would of taken around 5 hours to get some
      popcorn. These puppies can read tags at 10m (even through walls as I discovered) but
      excite a popcorn kernel, they can not...we need more power.
   </p>
        <p>
      What I need is one of those "lasers"
   </p>
        <p>
       <a href="http://www.breezetraining.com.au/blogs/scotts/content/binary/TheGreatPhoneFryupSwindle_9337/drevil.jpg"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="244" alt="drevil" src="http://www.breezetraining.com.au/blogs/scotts/content/binary/TheGreatPhoneFryupSwindle_9337/drevil_thumb.jpg" width="153" border="0" /></a></p>
        <h2>Who wants steak!
   </h2>
        <img width="0" height="0" src="http://blogs.breezetraining.com.au/scotts/aggbug.ashx?id=6c1561dd-81b6-461b-aafc-67bad10ddde3" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Silverlight 2 Beta 2 and Duplex WCF Services</title>
    <link rel="alternate" type="text/html" href="http://blogs.breezetraining.com.au/scotts/2008/06/28/Silverlight2Beta2AndDuplexWCFServices.aspx" />
    <id>http://blogs.breezetraining.com.au/scotts/PermaLink,guid,5f9bcff7-ac69-4286-996e-465441f4253d.aspx</id>
    <published>2008-06-27T17:15:38.966875-07:00</published>
    <updated>2008-06-27T17:15:38.966875-07:00</updated>
    <category term="Silverlight" label="Silverlight" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      While working on a BizTalk RFID project we (<a href="http://blogs.breezetraining.com.au/mickb/" target="_blank">Mick</a>, <a href="http://blogs.msdn.com/rgarg/default.aspx" target="_blank">Rahul</a>,
      and I) wanted to explore whether we could use Silverlight (SL) to display tag read
      events as they are captured. As usual in these scenarios, I started writing wonderfully
      creative cheque's my graphic design skills could not cash. Eventually I put together
      an acceptable looking SL page with a couple of animated user controls to represent
      the received tag read events and counters.
   </p>
        <p>
          <a href="http://www.breezetraining.com.au/blogs/scotts/content/binary/SilverlightBeta2andDuplexWCFServices_E8DE/silverlightdisplayinaction.jpg">
            <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="346" alt="silverlight display in action" src="http://www.breezetraining.com.au/blogs/scotts/content/binary/SilverlightBeta2andDuplexWCFServices_E8DE/silverlightdisplayinaction_thumb.jpg" width="555" border="0" />
          </a>
        </p>
        <p>
      The trick was how do we notify the SL application of the tag read event. At first
      we went down the client polling route and that worked out fine, but we really wanted
      something akin to duplex communications in WCF. That is, we want the service to push
      data out to the client when the service receives the event.
   </p>
        <p>
      At the time we were working with SL 2 Beta 1 and quickly realised two constraining
      factors
   </p>
        <ol>
          <li>
         Silverlight only supports http based WCF bindings. 
      </li>
          <li>
         Security restrictions prevent the SL application from creating callback listeners.</li>
        </ol>
        <p>
      Luckily for us Tech.Ed 2008 in the US was running and the team at Microsoft announced
      Beta 2 with support for a polling duplex communications model. After decoding the
      beta documentation <img alt="smile_confused" src="http://spaces.live.com/rte/emoticons/smile_confused.gif" />,
      and some help from learned blogger's, we cracked that puppy and got a Silverlight
      2 Beta 2 version working. 
   </p>
        <p>
      Here is a outline of the WCF bits of the Silverlight solution.
   </p>
        <ul>
          <li>
         Create a new "Silverlight" flavoured WCF service containing both a service contract
         and a client callback contract (a duplex service).<br /><br /><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="339" alt="silverlight service contract" src="http://www.breezetraining.com.au/blogs/scotts/content/binary/SilverlightBeta2andDuplexWCFServices_E8DE/silverlightservicecontract.jpg" width="498" border="0" /><br /></li>
          <li>
         Implement the SubscribeToEvents operation ensuring you set a reference to the client
         callback channel. This is how we send events back to the SL application.<br /><pre class="csharpcode"><span class="rem">// Obtain a reference to the client callback
         channel</span> _callback = OperationContext.Current.GetCallbackChannel&lt;IDuplexServiceCallback&gt;();</pre><style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style></li>
        </ul>
        <p>
          <br />
        </p>
        <ul>
          <li>
         Implement the client callback. In our case, when the WCF service receives a tag read
         event from BizTalk RFID, we create a new message instance containing the event data
         and invoke the client callback method NotifyEvent()<br /><pre class="csharpcode"><span class="rem">// Construct NotifyEvent message</span> Message
         message = Message.CreateMessage(MessageVersion.Soap11, <span class="str">"Silverlight/IDuplexService/NotifyEvent"</span>,
         xmlEventData); <span class="rem">// Push event to client</span> _callback.NotifyEvent(message);<br /><br /></pre></li>
        </ul>
        <ul>
          <li>
         Create your own service host and custom binding that uses the <a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.pollingduplexhttpbinding(VS.95).aspx" target="_blank">PollingDuplexBindingElement</a> located
         in the new System.ServiceModel.PollingDuplex assembly in the SL 2 Beta 2 SDK (the
         one in the ..\Libraries\<strong>Server</strong>\Evaluation folder).<br /></li>
          <li>
         In the SL application we create a duplex polling receiver class (see the <a href="http://msdn.microsoft.com/en-us/library/cc645028(VS.95).aspx" target="_blank">Silverlight
         documentation</a> for details) and use the PollingDuplexHttpBinding class to create
         factory and channel objects to send a message to the service. We then start a message
         receive loop to listen for messages sent by the service. 
         <br /></li>
          <li>
         Received events are then routed to the SL Page class. In our SL Page class we create
         instances of user controls for each event received and update some running counters.</li>
        </ul>
        <p>
      I did feel some pain around the WCF message formats (see point 3 above). At first
      I got the message action wrong, but no exceptions were thrown at all warning me of
      this...the SL application just sat there waiting for the callback. You have to make
      sure the message action here matches the callback operation exactly. That is, <strong>&lt;ServiceContractNamespace&gt;/&lt;ServiceInterface&gt;/&lt;Operation&gt;</strong>.
   </p>
        <p>
      As this is just a POC, I'm sure it will completely change (more than once) as it matures
      into production ready code, but I thought I might share what we are doing around Silverlight,
      WCF, and BizTalk.
   </p>
        <p>
      Also, <a href="http://weblogs.asp.net/dwahlin/archive/2008/06/16/pushing-data-to-a-silverlight-client-with-wcf-duplex-service-part-i.aspx" target="_blank">Dan
      Wahlin</a> has a great post detailing how to push data to a Silverlight application
      using WCF duplex services. Much of his work was used to understand how to put all
      these Silverlight and WCF pieces together. Thanks heaps Dan. <img alt="beer" src="http://spaces.live.com/rte/emoticons/beer.gif" /></p>
        <img width="0" height="0" src="http://blogs.breezetraining.com.au/scotts/aggbug.ashx?id=5f9bcff7-ac69-4286-996e-465441f4253d" />
      </div>
    </content>
  </entry>
  <entry>
    <title>R.I.P VMware Server</title>
    <link rel="alternate" type="text/html" href="http://blogs.breezetraining.com.au/scotts/2008/06/20/RIPVMwareServer.aspx" />
    <id>http://blogs.breezetraining.com.au/scotts/PermaLink,guid,48d6f390-82cc-4eff-a6d7-d095eb1b7781.aspx</id>
    <published>2008-06-20T16:49:57.385375-07:00</published>
    <updated>2008-06-20T16:54:25.385375-07:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      I have been an advocate of VMware Server (v1.0) having used it for the past three
      or so years now as my virtual development platform. The performance, networking, and
      user experience have all been good enough. I have accumulated a decent library of
      platforms, server products, developer tools, and client environments that I can call
      upon whenever needed. I especially liked the USB support which came in handy when
      working with RFID devices.
   </p>
        <p>
      Recently I got around to installing the latest version (v2.0 beta) ...oh dear <img alt="smile_sad" src="http://spaces.live.com/rte/emoticons/smile_sad.gif" />.
   </p>
        <p>
      Ok, it was only beta but it lost all the attributes that I mentioned as good points
      above. Performance was noticeably poorer (perhaps beta related), the revamped networking
      might be ok after a training course, and most importantly the user experience was
      totally shite. VMware moved away from the remote console being a Rich UI application
      (that had its faults but got the job done well enough) to a browser-based console.
      Why? I thought the industry has have moved on from this already <img alt="smile_confused" src="http://spaces.live.com/rte/emoticons/smile_confused.gif" />.
   </p>
        <p>
      So, I have finally conceded to (and coped a few ha-ha's from colleagues) to move my
      virtualisation platform over to Windows Server 2008 Hyper-V. No small job as I will
      have to convert (rebuild) all my VM's. In the meantime, I am running Virtual Server
      2005 R2 on the laptop to "ease" myself into the new platform.
   </p>
        <p>
       
   </p>
        <p>
          <a href="http://www.breezetraining.com.au/blogs/scotts/content/binary/R.I.PVMwareServer_8A1C/ripvmwaredone.jpg">
            <img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="240" alt="rip vmware done" src="http://www.breezetraining.com.au/blogs/scotts/content/binary/R.I.PVMwareServer_8A1C/ripvmwaredone_thumb.jpg" width="180" border="0" />
          </a>
        </p>
        <p>
       
   </p>
   Good bye old friend.<img width="0" height="0" src="http://blogs.breezetraining.com.au/scotts/aggbug.ashx?id=48d6f390-82cc-4eff-a6d7-d095eb1b7781" /></div>
    </content>
  </entry>
  <entry>
    <title>List of functions and operators used in Orchestrations</title>
    <link rel="alternate" type="text/html" href="http://blogs.breezetraining.com.au/scotts/2008/06/05/ListOfFunctionsAndOperatorsUsedInOrchestrations.aspx" />
    <id>http://blogs.breezetraining.com.au/scotts/PermaLink,guid,455b0d7f-fffd-4806-bf4a-5c040fa9b38a.aspx</id>
    <published>2008-06-05T07:42:47.51875-07:00</published>
    <updated>2008-06-05T07:42:47.51875-07:00</updated>
    <category term="BizTalk General" label="BizTalk General" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Recently I implemented a BizTalk web services interface that required the need to
      support SoapFault messages. I quickly fell into a common trap and received a compiler
      error:
   </p>
        <blockquote>
          <p>
            <code>error X2162: must receive before sending a fault message on an implemented port</code>
          </p>
        </blockquote>
        <p>
      (see <a href="http://www.traceofthought.net/2004/04/21/TheSucceededOperatorInBizTalk2004Orchestrations.aspx" target="_blank">Scott
      Colestock's post</a> that nicely outlines his experience with the same issue)
   </p>
        <p>
      As Scott describes, the solution involved using the <em>succeeded()</em> function
      to first test if a transaction scope had succeeded or not in order to send out my
      soap-fault correctly. I vaguely recalled this function but never used it in anger
      before. After having spent a hour or so I will never get back, I made a note-to-self
      to seek out and reacquaint myself with the other operators and functions available
      to use in expression shapes within an orchestration.
   </p>
        <p>
      Here is the full list taken from the <a href="http://msdn.microsoft.com/en-us/library/aa561847.aspx" target="_blank">online
      documentation</a>:
   </p>
        <form id="aspnetForm" name="aspnetForm" action="aa561847.aspx" method="post">
          <table style="width: 489pt; border-collapse: collapse" cellspacing="0" cellpadding="0" width="652" border="0">
            <colgroup>
              <font size="2">
                <col style="width: 62pt; mso-width-source: userset; mso-width-alt: 2998" width="82" />
                <col style="width: 122pt; mso-width-source: userset; mso-width-alt: 5961" width="163" />
                <col style="width: 305pt; mso-width-source: userset; mso-width-alt: 14884" width="407" />
              </font>
              <tbody>
                <tr style="height: 15.75pt" height="21">
                  <td class="xl65" style="border-right: medium none; border-top: #4f81bd 0.5pt solid; font-weight: 700; font-size: 8pt; border-left: medium none; width: 62pt; color: windowtext; border-bottom: #4f81bd 0.5pt solid; font-family: 'Trebuchet MS'; height: 15.75pt; text-decoration: none; text-underline-style: none; text-line-through: none; mso-background-source: auto; mso-pattern: auto" width="82" height="21">
                    <p>
                      <font size="2">Operator</font>
                    </p>
                  </td>
                  <td class="xl65" style="border-right: medium none; border-top: #4f81bd 0.5pt solid; font-weight: 700; font-size: 8pt; border-left: medium none; width: 122pt; color: windowtext; border-bottom: #4f81bd 0.5pt solid; font-family: 'Trebuchet MS'; text-decoration: none; text-underline-style: none; text-line-through: none; mso-background-source: auto; mso-pattern: auto" width="163">
                    <p>
                      <font size="2">Description</font>
                    </p>
                  </td>
                  <td class="xl65" style="border-right: medium none; border-top: #4f81bd 0.5pt solid; font-weight: 700; font-size: 8pt; border-left: medium none; width: 305pt; color: windowtext; border-bottom: #4f81bd 0.5pt solid; font-family: 'Trebuchet MS'; text-decoration: none; text-underline-style: none; text-line-through: none; mso-background-source: auto; mso-pattern: auto" width="407">
                    <p>
                      <font size="2">Example</font>
                    </p>
                  </td>
                </tr>
                <tr style="height: 27pt" height="36">
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 62pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; height: 27pt; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="82" height="36">
                    <p>
                      <font size="2">checked()</font>
                    </p>
                  </td>
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 122pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="163">
                    <p>
                      <font size="2">raise error on arithmetic overflow</font>
                    </p>
                  </td>
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 305pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="407">
                    <p>
                      <font size="2">checked(x = y * 1000)</font>
                    </p>
                  </td>
                </tr>
                <tr style="height: 15pt" height="20">
                  <td class="xl66" style="width: 62pt; height: 15pt" width="82" height="20">
                    <p>
                      <font size="2">unchecked()</font>
                    </p>
                  </td>
                  <td class="xl66" style="width: 122pt" width="163">
                    <p>
                      <font size="2">ignore arithmetic overflow</font>
                    </p>
                  </td>
                  <td class="xl66" style="width: 305pt" width="407">
                    <p>
                      <font size="2">unchecked(x = y * 1000)</font>
                    </p>
                  </td>
                </tr>
                <tr style="height: 15pt" height="20">
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 62pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; height: 15pt; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="82" height="20">
                    <p>
                      <font size="2">new</font>
                    </p>
                  </td>
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 122pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="163">
                    <p>
                      <font size="2">create an instance of a class</font>
                    </p>
                  </td>
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 305pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="407">
                    <p>
                      <font size="2">myObject = new MyClass;</font>
                    </p>
                  </td>
                </tr>
                <tr style="height: 15pt" height="20">
                  <td class="xl66" style="width: 62pt; height: 15pt" width="82" height="20">
                    <p>
                      <font size="2">typeof</font>
                    </p>
                  </td>
                  <td class="xl66" style="width: 122pt" width="163">
                    <p>
                      <font size="2">Type retrieval</font>
                    </p>
                  </td>
                  <td class="xl66" style="width: 305pt" width="407">
                    <p>
                      <font size="2">myMapType = typeof(myMap)</font>
                    </p>
                  </td>
                </tr>
                <tr style="height: 40.5pt" height="54">
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 62pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; height: 40.5pt; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="82" height="54">
                    <p>
                      <font size="2">succeeded()</font>
                    </p>
                  </td>
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 122pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="163">
                    <p>
                      <font size="2">test for successful completion of transactional scope or orchestration</font>
                    </p>
                  </td>
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 305pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="407">
                    <p>
                      <font size="2">succeeded(&lt;transaction ID for child transaction of current scope
                        or service&gt;)</font>
                    </p>
                  </td>
                </tr>
                <tr style="height: 27pt" height="36">
                  <td class="xl66" style="width: 62pt; height: 27pt" width="82" height="36">
                    <p>
                      <font size="2">exists</font>
                    </p>
                  </td>
                  <td class="xl66" style="width: 122pt" width="163">
                    <p>
                      <font size="2">test for the existence of a message context property</font>
                    </p>
                  </td>
                  <td class="xl66" style="width: 305pt" width="407">
                    <p>
                      <font size="2">BTS.RetryCount exists Message_In</font>
                    </p>
                  </td>
                </tr>
                <tr style="height: 15pt" height="20">
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 62pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; height: 15pt; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="82" height="20">
                    <p>
                      <font size="2">+</font>
                    </p>
                  </td>
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 122pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="163">
                    <p>
                      <font size="2">unary plus</font>
                    </p>
                  </td>
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 305pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="407">
                    <p>
                      <font size="2">+(int x)</font>
                    </p>
                  </td>
                </tr>
                <tr style="height: 15pt" height="20">
                  <td class="xl66" style="width: 62pt; height: 15pt" width="82" height="20">
                    <p>
                      <font size="2">-</font>
                    </p>
                  </td>
                  <td class="xl66" style="width: 122pt" width="163">
                    <p>
                      <font size="2">unary minus</font>
                    </p>
                  </td>
                  <td class="xl66" style="width: 305pt" width="407">
                    <p>
                      <font size="2">-(int x)</font>
                    </p>
                  </td>
                </tr>
                <tr style="height: 15pt" height="20">
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 62pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; height: 15pt; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="82" height="20">
                    <p>
                      <font size="2">!</font>
                    </p>
                  </td>
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 122pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="163">
                    <p>
                      <font size="2">logical negation</font>
                    </p>
                  </td>
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 305pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="407">
                    <p>
                      <font size="2">!myBool</font>
                    </p>
                  </td>
                </tr>
                <tr style="height: 15pt" height="20">
                  <td class="xl66" style="width: 62pt; height: 15pt" width="82" height="20">
                    <p>
                      <font size="2">~</font>
                    </p>
                  </td>
                  <td class="xl66" style="width: 122pt" width="163">
                    <p>
                      <font size="2">bitwise complement</font>
                    </p>
                  </td>
                  <td class="xl66" style="width: 305pt" width="407">
                    <p>
                      <font size="2">x = ~y</font>
                    </p>
                  </td>
                </tr>
                <tr style="height: 15pt" height="20">
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 62pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; height: 15pt; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="82" height="20">
                    <p>
                      <font size="2">()</font>
                    </p>
                  </td>
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 122pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="163">
                    <p>
                      <font size="2">cast</font>
                    </p>
                  </td>
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 305pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="407">
                    <p>
                      <font size="2">(bool) myInt</font>
                    </p>
                  </td>
                </tr>
                <tr style="height: 15pt" height="20">
                  <td class="xl66" style="width: 62pt; height: 15pt" width="82" height="20">
                    <p>
                      <font size="2">*</font>
                    </p>
                  </td>
                  <td class="xl66" style="width: 122pt" width="163">
                    <p>
                      <font size="2">times</font>
                    </p>
                  </td>
                  <td class="xl66" style="width: 305pt" width="407">
                    <p>
                      <font size="2">Weight = MyMsg.numOrders * 20</font>
                    </p>
                  </td>
                </tr>
                <tr style="height: 15pt" height="20">
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 62pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; height: 15pt; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="82" height="20">
                    <p>
                      <font size="2">/</font>
                    </p>
                  </td>
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 122pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="163">
                    <p>
                      <font size="2">divided by</font>
                    </p>
                  </td>
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 305pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="407">
                    <p>
                      <font size="2">x / y</font>
                    </p>
                  </td>
                </tr>
                <tr style="height: 15pt" height="20">
                  <td class="xl66" style="width: 62pt; height: 15pt" width="82" height="20">
                    <p>
                      <font size="2">+</font>
                    </p>
                  </td>
                  <td class="xl66" style="width: 122pt" width="163">
                    <p>
                      <font size="2">plus</font>
                    </p>
                  </td>
                  <td class="xl66" style="width: 305pt" width="407">
                    <p>
                      <font size="2">x + y</font>
                    </p>
                  </td>
                </tr>
                <tr style="height: 15pt" height="20">
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 62pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; height: 15pt; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="82" height="20">
                    <p>
                      <font size="2">-</font>
                    </p>
                  </td>
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 122pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="163">
                    <p>
                      <font size="2">minus</font>
                    </p>
                  </td>
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 305pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="407">
                    <p>
                      <font size="2">x - y</font>
                    </p>
                  </td>
                </tr>
                <tr style="height: 15pt" height="20">
                  <td class="xl66" style="width: 62pt; height: 15pt" width="82" height="20">
                    <p>
                      <font size="2">&lt;&lt;</font>
                    </p>
                  </td>
                  <td class="xl66" style="width: 122pt" width="163">
                    <p>
                      <font size="2">shift left</font>
                    </p>
                  </td>
                  <td class="xl66" style="width: 305pt" width="407">
                    <p>
                      <font size="2">x &lt;&lt; 2</font>
                    </p>
                  </td>
                </tr>
                <tr style="height: 15pt" height="20">
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 62pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; height: 15pt; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="82" height="20">
                    <p>
                      <font size="2">&gt;&gt;</font>
                    </p>
                  </td>
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 122pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="163">
                    <p>
                      <font size="2">shift right</font>
                    </p>
                  </td>
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 305pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="407">
                    <p>
                      <font size="2">x &gt;&gt; 2</font>
                    </p>
                  </td>
                </tr>
                <tr style="height: 15pt" height="20">
                  <td class="xl66" style="width: 62pt; height: 15pt" width="82" height="20">
                    <p>
                      <font size="2">&lt;</font>
                    </p>
                  </td>
                  <td class="xl66" style="width: 122pt" width="163">
                    <p>
                      <font size="2">less than</font>
                    </p>
                  </td>
                  <td class="xl66" style="width: 305pt" width="407">
                    <p>
                      <font size="2">If (MyMsg.numOrders &lt; 10)...</font>
                    </p>
                  </td>
                </tr>
                <tr style="height: 15pt" height="20">
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 62pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; height: 15pt; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="82" height="20">
                    <p>
                      <font size="2">&gt;</font>
                    </p>
                  </td>
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 122pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="163">
                    <p>
                      <font size="2">greater than</font>
                    </p>
                  </td>
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 305pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="407">
                    <p>
                      <font size="2">If (MyMsg.numOrders &gt; 10)...</font>
                    </p>
                  </td>
                </tr>
                <tr style="height: 15pt" height="20">
                  <td class="xl66" style="width: 62pt; height: 15pt" width="82" height="20">
                    <p>
                      <font size="2">&lt;=</font>
                    </p>
                  </td>
                  <td class="xl66" style="width: 122pt" width="163">
                    <p>
                      <font size="2">less than or equal to</font>
                    </p>
                  </td>
                  <td class="xl66" style="width: 305pt" width="407">
                    <p>
                      <font size="2">If (MyMsg.numOrders &lt;= 10)...</font>
                    </p>
                  </td>
                </tr>
                <tr style="height: 15pt" height="20">
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 62pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; height: 15pt; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="82" height="20">
                    <p>
                      <font size="2">&gt;=</font>
                    </p>
                  </td>
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 122pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="163">
                    <p>
                      <font size="2">greater than or equal to</font>
                    </p>
                  </td>
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 305pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="407">
                    <p>
                      <font size="2">If (MyMsg.numOrders &gt;= 10)...</font>
                    </p>
                  </td>
                </tr>
                <tr style="height: 15pt" height="20">
                  <td class="xl66" style="width: 62pt; height: 15pt" width="82" height="20">
                    <p>
                      <font size="2">==</font>
                    </p>
                  </td>
                  <td class="xl66" style="width: 122pt" width="163">
                    <p>
                      <font size="2">equal to</font>
                    </p>
                  </td>
                  <td class="xl66" style="width: 305pt" width="407">
                    <p>
                      <font size="2">If (MyMsg.numOrders == 10)...</font>
                    </p>
                  </td>
                </tr>
                <tr style="height: 15pt" height="20">
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 62pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; height: 15pt; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="82" height="20">
                    <p>
                      <font size="2">!=</font>
                    </p>
                  </td>
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 122pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="163">
                    <p>
                      <font size="2">not equal to</font>
                    </p>
                  </td>
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 305pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="407">
                    <p>
                      <font size="2">If (MyMsg.numOrders != 10)...</font>
                    </p>
                  </td>
                </tr>
                <tr style="height: 15pt" height="20">
                  <td class="xl66" style="width: 62pt; height: 15pt" width="82" height="20">
                    <p>
                      <font size="2">&amp;</font>
                    </p>
                  </td>
                  <td class="xl66" style="width: 122pt" width="163">
                    <p>
                      <font size="2">and</font>
                    </p>
                  </td>
                  <td class="xl66" style="width: 305pt" width="407">
                    <p>
                      <font size="2">If (myByte &amp; 255)...</font>
                    </p>
                  </td>
                </tr>
                <tr style="height: 15pt" height="20">
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 62pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; height: 15pt; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="82" height="20">
                    <p>
                      <font size="2">^</font>
                    </p>
                  </td>
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 122pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="163">
                    <p>
                      <font size="2">exclusive or</font>
                    </p>
                  </td>
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 305pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="407">
                    <p>
                      <font size="2">If (myByte ^ 1)...</font>
                    </p>
                  </td>
                </tr>
                <tr style="height: 15pt" height="20">
                  <td class="xl66" style="width: 62pt; height: 15pt" width="82" height="20">
                    <p>
                      <font size="2">|</font>
                    </p>
                  </td>
                  <td class="xl66" style="width: 122pt" width="163">
                    <p>
                      <font size="2">or</font>
                    </p>
                  </td>
                  <td class="xl66" style="width: 305pt" width="407">
                    <p>
                      <font size="2">If (myByte | 1)...</font>
                    </p>
                  </td>
                </tr>
                <tr style="height: 15pt" height="20">
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 62pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; height: 15pt; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="82" height="20">
                    <p>
                      <font size="2">&amp;&amp;</font>
                    </p>
                  </td>
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 122pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="163">
                    <p>
                      <font size="2">conditional and</font>
                    </p>
                  </td>
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 305pt; color: windowtext; border-bottom: medium none; font-family: 'Trebuchet MS'; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="407">
                    <p>
                      <font size="2">If (MyMsg.numOrders &gt; 10) &amp;&amp; (MyMsg.numOrders &lt; 100)</font>
                    </p>
                  </td>
                </tr>
                <tr style="height: 15pt" height="20">
                  <td class="xl66" style="width: 62pt; height: 15pt" width="82" height="20">
                    <p>
                      <font size="2">||</font>
                    </p>
                  </td>
                  <td class="xl66" style="width: 122pt" width="163">
                    <p>
                      <font size="2">conditional or</font>
                    </p>
                  </td>
                  <td class="xl66" style="width: 305pt" width="407">
                    <p>
                      <font size="2">If (MyMsg.numOrders &lt; 10) || (MyMsg.numOrders &gt; 100)</font>
                    </p>
                  </td>
                </tr>
                <tr style="height: 15pt" height="20">
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 62pt; color: windowtext; border-bottom: #4f81bd 0.5pt solid; font-family: 'Trebuchet MS'; height: 15pt; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="82" height="20">
                    <p>
                      <font size="2">//</font>
                    </p>
                  </td>
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 122pt; color: windowtext; border-bottom: #4f81bd 0.5pt solid; font-family: 'Trebuchet MS'; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="163">
                    <p>
                      <font size="2">commenting</font>
                    </p>
                  </td>
                  <td class="xl66" style="border-right: medium none; border-top: medium none; font-weight: 400; font-size: 8pt; background: #dbe5f1; border-left: medium none; width: 305pt; color: windowtext; border-bottom: #4f81bd 0.5pt solid; font-family: 'Trebuchet MS'; text-decoration: none; text-underline-style: none; text-line-through: none; mso-pattern: #dbe5f1 none" width="407">
                  </td>
                </tr>
              </tbody>
            </colgroup>
          </table>
        </form>
        <p>
        </p>
        <form id="aspnetForm" name="aspnetForm" action="aa561847.aspx" method="post">
          <font size="2">//This is the comment</font>
        </form>
        <form id="aspnetForm" name="aspnetForm" action="aa561847.aspx" method="post">
          <font size="2">
          </font>
        </form>
        <p>
      Since then, this little exercise has helped in a few occasions, particularly the need
      for the <em>exists</em> function when working with optional property schema fields.
   </p>
        <p>
      I knew I should of read the manufacturers instructions <img alt="smile_wink" src="http://spaces.live.com/rte/emoticons/smile_wink.gif" /></p>
        <img width="0" height="0" src="http://blogs.breezetraining.com.au/scotts/aggbug.ashx?id=455b0d7f-fffd-4806-bf4a-5c040fa9b38a" />
      </div>
    </content>
  </entry>
  <entry>
    <title>MIME.FileName not populated</title>
    <link rel="alternate" type="text/html" href="http://blogs.breezetraining.com.au/scotts/2008/05/26/MIMEFileNameNotPopulated.aspx" />
    <id>http://blogs.breezetraining.com.au/scotts/PermaLink,guid,ee167577-c354-49af-906d-95d578b98a86.aspx</id>
    <published>2008-05-26T07:10:09.1301749-07:00</published>
    <updated>2008-05-26T07:10:09.1301749-07:00</updated>
    <category term="BizTalk General" label="BizTalk General" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
        </p>
        <p>
      Today I was working on a BizTalk solution to intercept, transform, and relay emails
      sent from a LOB system. BizTalk polled a POP3 mailbox and my orchestration replaced
      the original plain/text email body with some fancy, template driven HTML content and
      sent it out a dynamic SMTP send port. Only the email body was to be modified, the
      rest of the email message was to replicate the original email message, including any
      attachments (that may or may not be present).
   </p>
        <p>
      To aid in testing I wrote a simple .Net email client. (I got tired of composing a
      new email in Outlook every time I wanted to test the solution)
   </p>
        <p>
          <img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="307" alt="Breeze Simple Email Client" src="http://www.breezetraining.com.au/blogs/scotts/content/binary/MIME.Filenamenotpopulated_1363E/BreezeSimpleEmailClient.png" width="395" border="0" />
        </p>
        <p>
      The solution worked well (and perhaps I may post about the details sometime later)
      accept for the fact the outbound message had lost the attachment filenames.
   </p>
        <p>
          <a href="http://www.breezetraining.com.au/blogs/scotts/content/binary/MIME.Filenamenotpopulated_1363E/inboundshowingattachment.png">
            <img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="295" alt="inbound showing attachment" src="http://www.breezetraining.com.au/blogs/scotts/content/binary/MIME.Filenamenotpopulated_1363E/inboundshowingattachment_thumb.png" width="401" border="0" />
          </a>
        </p>
        <p>
          <a href="http://www.breezetraining.com.au/blogs/scotts/content/binary/MIME.Filenamenotpopulated_1363E/outboundshowingattachment.png">
            <img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="295" alt="outbound showing attachment" src="http://www.breezetraining.com.au/blogs/scotts/content/binary/MIME.Filenamenotpopulated_1363E/outboundshowingattachment_thumb.png" width="399" border="0" />
          </a>
        </p>
        <p>
      Note: The attachment on the outbound message has a filename of ATT00241.DAT <img alt="smile_confused" src="http://spaces.live.com/rte/emoticons/smile_confused.gif" /></p>
        <p>
      A helper class in my orchestration inspected the inbound message for attachments and
      added them to the new outbound message. Each message part (attachment) was assigned
      the MIME message part context properties of the same inbound message part. What I
      found was the MIME.FileName property was not being populated by the MIME decoder.
   </p>
        <p>
      The MIME decoder in the POP3 adapter (when configured to apply MIME decoding) populates
      the following message part context properties when a MIME encoded message is received:
   </p>
        <p>
          <a title="MIME/SMIME Property Schema and Properties" href="http://msdn.microsoft.com/en-us/library/aa559271.aspx" target="_blank">
            <img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="250" alt="MIME/SMIME Property Schema and Properties" src="http://www.breezetraining.com.au/blogs/scotts/content/binary/MIME.Filenamenotpopulated_1363E/image.png" width="614" border="0" />
          </a>
        </p>
        <p>
      I checked the message source of the email I was sending (via my DIY email client)
      to check the MIME headers were present.
   </p>
        <p>
          <a href="http://www.breezetraining.com.au/blogs/scotts/content/binary/MIME.Filenamenotpopulated_1363E/incorrectmessagesource.png">
            <img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="343" alt="incorrect message source" src="http://www.breezetraining.com.au/blogs/scotts/content/binary/MIME.Filenamenotpopulated_1363E/incorrectmessagesource_thumb.png" width="382" border="0" />
          </a>
        </p>
        <p>
      Appears OK right?...
   </p>
        <blockquote>
          <p>
      content-type: application/octet-stream; name=SampleAttachment.zip<br />
      content-transfer-encoding: base64
   </p>
        </blockquote>
        <p>
      Wrong <img alt="smile_embaressed" src="http://spaces.live.com/rte/emoticons/smile_embaressed.gif" /></p>
        <p>
      It turns out the MIME decoder is looking for the content-disposition header values
   </p>
        <blockquote>
          <p>
      content-type: application/octet-stream; name=SampleAttachment.zip<br />
      content-transfer-encoding: base64<br /><strong>content-disposition: attachment; filename=SampleAttachment.zip</strong></p>
        </blockquote>
        <p>
      So some quick changes to the Breeze Simple Email Client ...
   </p>
        <blockquote>
          <p>
      attach.ContentDisposition.DispositionType = System.Net.Mime.DispositionTypeNames.Attachment<br />
      attach.ContentDisposition.FileName = Path.GetFileName(attachmentFileName)
   </p>
        </blockquote>
        <p>
      ...and we were back to cooking with gas.
   </p>
        <p>
          <a href="http://www.breezetraining.com.au/blogs/scotts/content/binary/MIME.Filenamenotpopulated_1363E/correctmessagesource.png">
            <img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="410" alt="correct message source" src="http://www.breezetraining.com.au/blogs/scotts/content/binary/MIME.Filenamenotpopulated_1363E/correctmessagesource_thumb.png" width="396" border="0" />
          </a>
        </p>
        <p>
      and now attachments on our outbound message retain their original filename...noysh!
   </p>
        <p>
          <a href="http://www.breezetraining.com.au/blogs/scotts/content/binary/MIME.Filenamenotpopulated_1363E/outboundshowingcorrectattachment.png">
            <img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="293" alt="outbound showing correct attachment" src="http://www.breezetraining.com.au/blogs/scotts/content/binary/MIME.Filenamenotpopulated_1363E/outboundshowingcorrectattachment_thumb.png" width="397" border="0" />
          </a>
        </p>
        <p>
      And BTW, not all commercial email clients populate these MIME headers correctly either
      (or so a friend of a friend who's aunt once knew someone that was talking to a girlfriend
      at the supermarket said). Check out the message source of items in your inbox. You
      might be surprised. <img alt="smile_regular" src="http://spaces.live.com/rte/emoticons/smile_regular.gif" /></p>
        <p>
      Happy <strike>spamming</strike> er...umm...BizTalking
   </p>
        <img width="0" height="0" src="http://blogs.breezetraining.com.au/scotts/aggbug.ashx?id=ee167577-c354-49af-906d-95d578b98a86" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Updating database facts when calling policies in RFID processes</title>
    <link rel="alternate" type="text/html" href="http://blogs.breezetraining.com.au/scotts/2007/10/29/UpdatingDatabaseFactsWhenCallingPoliciesInRFIDProcesses.aspx" />
    <id>http://blogs.breezetraining.com.au/scotts/PermaLink,guid,91f9db6a-6da6-4037-86c9-c3c91dbe0665.aspx</id>
    <published>2007-10-29T05:10:14.151875-07:00</published>
    <updated>2007-10-29T05:15:20.0425-07:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      BizTalk RFID ships with the Business Rules Framework (commonly called the Business
      Rules Engine or BRE). BRE is a rules execution engine that allows you to dynamically
      create, publish, deploy, and execute policies without having to stop and restart running
      business processes. There is actually much, much more to BRE than my one sentence
      overview, but that is not what this post is all about.
   </p>
        <p>
      In BizTalk RFID land, we can call our business policies within RFID Processes using
      the OOTB <a href="http://msdn2.microsoft.com/en-us/library/bb755359.aspx" target="_blank">RuleEnginePolicyExecutor</a> component.
      We can use business rules to filter and enrich RFID tag event data. Having created
      the policy, we add and configure an instance of the RuleEnginePolicyExecutor component
      to our RFID process. We configure the component to specify any database and/or xml
      facts to pass to the executing policy. 
   </p>
        <p>
      A good friend to business rule developers working with BizTalk RFID processes is the <a href="http://msdn2.microsoft.com/en-us/library/microsoft.sensorservices.rfid.processcomponents.rfidruleenginecontext.aspx" target="_blank">RfidRuleEngineContext</a> class.
      It contains a number of properties and methods that make working with tag read event
      data very easy. An instance of this class is always passed to the executing policy
      by the RuleEnginePolicyExecutor component.
   </p>
        <p>
      Ok, so there is some context for the post...
   </p>
        <p>
          <u>The Problem:</u>
        </p>
        <p>
      The other day, I had a BRE policy that, amongst other things, was updating SQL tables
      in some rule actions. I was calling the BRE policy from a BizTalk RFID process and
      all was working fine, until I noticed the database changes were not being made. I
      checked the process log file and verified the SQL update rule actions were firing...but
      the database facts were not being updated. Why?
   </p>
        <blockquote>
          <p>
            <strong>Tip: </strong>
            <a href="http://msdn2.microsoft.com/en-us/library/bb749800.aspx" target="_blank">
              <strong>Troubleshooting
      BRE policy execution</strong>
            </a>
            <strong> within a RFID process is made easy by setting
      the process log level to Verbose. This writes all BRE tracking info to the process
      log file. <img alt="smile_wink" src="http://spaces.live.com/rte/emoticons/smile_wink.gif" /></strong>
          </p>
        </blockquote>
        <p>
      In BizTalk Orchestrations, when we update database facts in rule actions, we had to
      manually commit the changes on the SQL Data Connection (using an expression shape,
      not the call rules shape). 
   </p>
        <p>
          <u>The Solution:</u>
        </p>
        <p>
      In BizTalk RFID we can use the <a href="http://msdn2.microsoft.com/en-us/library/microsoft.sensorservices.rfid.processcomponents.rfidruleenginecontext.updatedataconnections.aspx" target="_blank">RfidRuleEngineContext.UpdateDataConnections</a> method
      to commit all changes on the SQL data connection(s) used during policy execution (the
      database fact we configured at design time). Keep in mind the message handling reliability
      setting (sometimes called the Tag Processing Mode) of your RFID process. If you have
      set message handling reliability to Transactional, BizTalk RFID will create a transaction
      scope over all event handlers in the process. That is, if any event handler fails,
      the transaction is aborted.
   </p>
        <blockquote>
          <p>
            <strong>
              <a title="Mick Badran" href="http://blogs.breezetraining.com.au/mickb" target="_blank">Mick's
      Tip</a>: Include <font face="Courier New" size="2">enlist=false;</font> in your connection
      string when configuring the RuleEnginePolicyExecutor if you do not want your SQL data
      connection to participate in the transaction. <img alt="smile_wink" src="http://spaces.live.com/rte/emoticons/smile_wink.gif" /></strong>
          </p>
        </blockquote>
        <p>
      The Business Rules Engine is a powerful tool in your BizTalk RFID toolbox. If you
      have never used it before, check out the <a title="Walkthroughs for Creating and Using Policies in RFID Processes" href="http://msdn2.microsoft.com/en-us/library/bb746166.aspx" target="_blank">Walkthroughs
      for Creating and Using Policies in RFID Processes</a> in the online help. There is
      also a great sample in the SDK as well.
   </p>
        <img width="0" height="0" src="http://blogs.breezetraining.com.au/scotts/aggbug.ashx?id=91f9db6a-6da6-4037-86c9-c3c91dbe0665" />
      </div>
    </content>
  </entry>
  <entry>
    <title>The process has a component that is not reachable</title>
    <link rel="alternate" type="text/html" href="http://blogs.breezetraining.com.au/scotts/2007/10/21/TheProcessHasAComponentThatIsNotReachable.aspx" />
    <id>http://blogs.breezetraining.com.au/scotts/PermaLink,guid,83891d1b-e4a4-4db7-b0d0-dd29574f3e2b.aspx</id>
    <published>2007-10-21T06:42:35.723125-07:00</published>
    <updated>2007-10-21T06:42:35.723125-07:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      If you are receiving this error when validating your RFID process and don't know why,
      or you have never seen this error before, read on as it just might save you some pain...
   </p>
        <p>
          <strong>RFID Processes - 101</strong>
          <img alt="smile_nerd" src="http://spaces.live.com/rte/emoticons/smile_nerd.gif" />
        </p>
        <p>
      RFID Processes consist of device bindings and component bindings. The device bindings
      link physical RFID devices to logical devices. Component bindings define the event
      handlers that perform the processing. Conceptually, an RFID process looks something
      like this:
   </p>
        <p>
       <img src="http://msdn2.microsoft.com/en-us/library/Bb750125.fa342433-d384-46cf-8e6e-300777b82e2b(en-us,MSDN.10).gif" /></p>
        <p>
          <em>Source: Microsoft BizTalk RFID Online Help</em>
        </p>
        <p>
      When PhysicalDevice1 raises an event, it is sent via LogicalDevice1 to EventHandler1
      for processing. EventHandler1 processes the event and passes the event data to EventHandler2.
      Event handlers can also terminate the event processing and not pass the event on.
      (but lets leave that for another post)
   </p>
        <p>
      When we put together RFID Processes that consist of multiple event handlers, we need
      to ensure that each event handler in the process can accept the event(s) passed from
      the previous one.
   </p>
        <style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
        <style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
        <p>
          <strong>Back to the Problem</strong>
        </p>
        <p>
      BizTalk RFID will throw "The process has a component that is not reachable..." error
      when it determines that an event handler in the process can not receive an event.
   </p>
        <p>
          <a href="http://www.breezetraining.com.au/blogs/scotts/content/binary/Theprocesshasacomponentthatisnotreachabl_13CBC/processvalidationerror.png">
            <img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="93" alt="process validation error" src="http://www.breezetraining.com.au/blogs/scotts/content/binary/Theprocesshasacomponentthatisnotreachabl_13CBC/processvalidationerror_thumb.png" width="244" border="0" />
          </a>
        </p>
        <p>
      This can happen in two ways:
   </p>
        <ol>
          <li>
         The device binding is not set and the event can not reach the first event handler.</li>
          <li>
         An event handler can not pass an event(s) to the next event handler in the pipeline.</li>
        </ol>
        <p>
      And it is this last case that can cause the pain.
   </p>
        <p>
          <strong>A Common Scenario</strong>
        </p>
        <p>
      You have a RFID process with two event handlers. The OOTB SqlServerSink event handler
      (EH1) and a custom event handler (EH2). BizTalk RFID throws the above error when you
      try to save. Why?..
   </p>
        <p>
      In this case the first event handler, SqlServerSink, is not designed to pass on events.
      It's event handler method has no output parameter. (check out the method signatures <a href="http://msdn2.microsoft.com/en-us/library/microsoft.sensorservices.rfid.processcomponents.sqlserversink.posteventtosink.aspx" target="_blank">PostEventToSink</a> and <a href="http://msdn2.microsoft.com/en-us/library/microsoft.sensorservices.rfid.processcomponents.sqlserversink.posteventstosink.aspx" target="_blank">PostEventsToSink</a> in
      online help) Event processing will always stop at the SqlServerSink component.
   </p>
        <p>
      The solution: Move the custom event handler (EH2) ahead of the SqlServerSink (EH1)
      event handler to pass validation.
   </p>
        <p>
          <strong>An Actual Scenario</strong>
          <em>(that resulted in much loss of sleep)</em>
        </p>
        <p>
      I had a RFID process that used the OOTB event handler RuleEnginePolicyExecutor to
      call BRE policies from the process. The next event handler in the pipeline was my
      custom component that I had used in many processes before with no issue. The output
      type of the <a href="http://msdn2.microsoft.com/en-us/library/microsoft.sensorservices.rfid.processcomponents.ruleenginepolicyexecutor.posteventtoruleengine.aspx" target="_blank">RuleEnginePolicyExecutor</a> event
      handler method(s) is RfidEventBase[]. The event handler method on my custom component
      only accepted RfidEventBase as an input parameter. That is, the RuleEnginePolicyExecutor
      component was passing my custom component an array of events and I only supported
      a single event in my event handler. 
   </p>
        <p>
      The solution: Create another event handler method that accepts RfidEventBase[] as
      the input parameter. I iterated through the array calling my original event handler
      method. Now my component supports both scenarios.
   </p>
        <p>
          <strong>Troubleshooting</strong>
        </p>
        <p>
      So when you receive this error, examine the message to identify the component at fault.
      Check the event handler method signatures of this and the previous component. What
      you are looking for:
   </p>
        <ol>
          <li>
         The previous event handler passes on the event (i.e. has an output parameter)</li>
          <li>
         The event handler at fault can accept the event (i.e. has an input parameter type
         that matches the event type sent)</li>
        </ol>
        <p>
      As event handlers can have more than one event handler method, ensure that the event
      handler at fault has an event handler method with the right input type for each of
      the output types of the previous component. This becomes quite complex when we consider
      pipelines mat contain multiple logical sources as well.<img alt="smile_confused" src="http://spaces.live.com/rte/emoticons/smile_confused.gif" /></p>
        <p>
          <strong>Tip: The Custom Event Handler Project Template that shipped with the SDK Samples
      only implements event handlers that accept TagReadEvent and TagListEvent input types.
      You will need to implement another event handler that accepts RfidEventBase[] as an
      input type to use your component with the RuleEnginePolicyExecutor component.</strong>
        </p>
        <img width="0" height="0" src="http://blogs.breezetraining.com.au/scotts/aggbug.ashx?id=83891d1b-e4a4-4db7-b0d0-dd29574f3e2b" />
      </div>
    </content>
  </entry>
</feed>