<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Dana Stevens</title>
        <link>http://theruntime.com/blogs/danastevens/Default.aspx</link>
        <description>Ruminations of a software developer.</description>
        <language>en-US</language>
        <copyright>Dana Stevens</copyright>
        <generator>Subtext Version 2.5.1.19</generator>
        <image>
            <title>Dana Stevens</title>
            <url>http://theruntime.com/blogs/images/RSS2Image.gif</url>
            <link>http://theruntime.com/blogs/danastevens/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>Drools on Windows (Part 3 of 22) - Object Interop</title>
            <category>Drools</category>
            <category>Java</category>
            <link>http://theruntime.com/blogs/danastevens/archive/2009/05/05/drools-on-windows-part-3-of-22---object-interop.aspx</link>
            <description>&lt;p&gt;In order to use the (amazingly cool) Drools rules engine in a .NET world, you've got to figure out how to pass your .NET business object over there to the land of Java.  There are a couple of ways to do this.  I wanted a straightforward way that didn't rely on any 3rd party tools.  Here's the gist of what we're trying to accomplish:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Instantiate a .NET object; populate with values.&lt;/li&gt;
    &lt;li&gt;Serialize the object and send it to a queue.&lt;/li&gt;
    &lt;li&gt;Java application monitors the queue; picks up the message text.&lt;/li&gt;
    &lt;li&gt;Java app unmarshals (i.e. deserializes) the text into a Java object.&lt;/li&gt;
    &lt;li&gt;Java app fires the rules, previously loaded, which may or may not modify the Java object's properties.&lt;/li&gt;
    &lt;li&gt;Java app marshals (i.e. serializes) the resulting object, and sends it to a queue.&lt;/li&gt;
    &lt;li&gt;.NET queue monitor picks up the message, deserializes it into a .NET object.&lt;/li&gt;
    &lt;li&gt;Excellent!&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To achieve this type of scenario just takes a bit of setup with the objects you intend to pass back and forth.  Here's one way how to do that setup.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;A.  Create your .NET object.&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Create a class library in .NET.  Here's an example of something we can tinker with for the duration of this blog series.  Compile it into a dll.&lt;/p&gt;
&lt;style type="text/css"&gt;&lt;![CDATA[





.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: 800px;
	margin: 0em;
}

.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Linq;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Text;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Xml.Serialization;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt; &lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; ZenDoodle.Common.Messaging.Models&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;{&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    [XmlRoot(Namespace = &lt;span class="str"&gt;"http://zendoodle.com/messaging/XML-Schema/2009"&lt;/span&gt;,&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;             ElementName = &lt;span class="str"&gt;"Customer"&lt;/span&gt;)]&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Customer&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;    {&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Name { get; set; }&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Address { get; set; }&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; City { get; set; }&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; State { get; set; }&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; PostalCode { get; set; }&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; CustomerType TypeOfCustomer { get; set; }&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; List&amp;lt;&lt;span class="kwrd"&gt;string&lt;/span&gt;&amp;gt; Messages { get; set; }&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt; &lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;enum&lt;/span&gt; CustomerType&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;        {&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;            Bronze,&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;            Silver,&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;            Gold,&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;            Platinum,&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;            Adamantium&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;        }&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;    }&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;u&gt;&lt;strong&gt;B.  Get your Xsd on.&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;Use the &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/x6c1kb0s.aspx"&gt;Microsoft-provided xsd.exe utility&lt;/a&gt; to create your Xsd file. Or hey, roll your own if that's your thing. Whatever.&lt;/p&gt;
&lt;p&gt;Sample command:&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;"C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\x64\xsd.exe" C:\Zen\Zendoodle.dll /o:C:\Zen\Schemas&lt;/font&gt;&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="html"&gt;xml&lt;/span&gt; &lt;span class="attr"&gt;version&lt;/span&gt;&lt;span class="kwrd"&gt;="1.0"&lt;/span&gt; &lt;span class="attr"&gt;encoding&lt;/span&gt;&lt;span class="kwrd"&gt;="utf-8"&lt;/span&gt;?&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xs:schema&lt;/span&gt; &lt;span class="attr"&gt;xmlns:tns&lt;/span&gt;&lt;span class="kwrd"&gt;="http://zendoodle.com/messaging/XML-Schema/2009"&lt;/span&gt; &lt;span class="attr"&gt;elementFormDefault&lt;/span&gt;&lt;span class="kwrd"&gt;="qualified"&lt;/span&gt; &lt;/pre&gt;
&lt;pre&gt;&lt;span class="attr"&gt;targetNamespace&lt;/span&gt;&lt;span class="kwrd"&gt;="http://zendoodle.com/messaging/XML-Schema/2009"&lt;/span&gt; &lt;span class="attr"&gt;xmlns:xs&lt;/span&gt;&lt;span class="kwrd"&gt;="http://www.w3.org/2001/XMLSchema"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xs:element&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="Customer"&lt;/span&gt; &lt;span class="attr"&gt;nillable&lt;/span&gt;&lt;span class="kwrd"&gt;="true"&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;="tns:Customer"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xs:complexType&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="Customer"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xs:sequence&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xs:element&lt;/span&gt; &lt;span class="attr"&gt;minOccurs&lt;/span&gt;&lt;span class="kwrd"&gt;="0"&lt;/span&gt; &lt;span class="attr"&gt;maxOccurs&lt;/span&gt;&lt;span class="kwrd"&gt;="1"&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="Name"&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;="xs:string"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xs:element&lt;/span&gt; &lt;span class="attr"&gt;minOccurs&lt;/span&gt;&lt;span class="kwrd"&gt;="0"&lt;/span&gt; &lt;span class="attr"&gt;maxOccurs&lt;/span&gt;&lt;span class="kwrd"&gt;="1"&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="Address"&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;="xs:string"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xs:element&lt;/span&gt; &lt;span class="attr"&gt;minOccurs&lt;/span&gt;&lt;span class="kwrd"&gt;="0"&lt;/span&gt; &lt;span class="attr"&gt;maxOccurs&lt;/span&gt;&lt;span class="kwrd"&gt;="1"&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="City"&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;="xs:string"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xs:element&lt;/span&gt; &lt;span class="attr"&gt;minOccurs&lt;/span&gt;&lt;span class="kwrd"&gt;="0"&lt;/span&gt; &lt;span class="attr"&gt;maxOccurs&lt;/span&gt;&lt;span class="kwrd"&gt;="1"&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="State"&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;="xs:string"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xs:element&lt;/span&gt; &lt;span class="attr"&gt;minOccurs&lt;/span&gt;&lt;span class="kwrd"&gt;="0"&lt;/span&gt; &lt;span class="attr"&gt;maxOccurs&lt;/span&gt;&lt;span class="kwrd"&gt;="1"&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="PostalCode"&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;="xs:string"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xs:element&lt;/span&gt; &lt;span class="attr"&gt;minOccurs&lt;/span&gt;&lt;span class="kwrd"&gt;="1"&lt;/span&gt; &lt;span class="attr"&gt;maxOccurs&lt;/span&gt;&lt;span class="kwrd"&gt;="1"&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="TypeOfCustomer"&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;="tns:CustomerType"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xs:element&lt;/span&gt; &lt;span class="attr"&gt;minOccurs&lt;/span&gt;&lt;span class="kwrd"&gt;="0"&lt;/span&gt; &lt;span class="attr"&gt;maxOccurs&lt;/span&gt;&lt;span class="kwrd"&gt;="1"&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="Messages"&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;="tns:ArrayOfString"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;xs:sequence&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;  &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;xs:complexType&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xs:simpleType&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="CustomerType"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xs:restriction&lt;/span&gt; &lt;span class="attr"&gt;base&lt;/span&gt;&lt;span class="kwrd"&gt;="xs:string"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xs:enumeration&lt;/span&gt; &lt;span class="attr"&gt;value&lt;/span&gt;&lt;span class="kwrd"&gt;="Bronze"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xs:enumeration&lt;/span&gt; &lt;span class="attr"&gt;value&lt;/span&gt;&lt;span class="kwrd"&gt;="Silver"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xs:enumeration&lt;/span&gt; &lt;span class="attr"&gt;value&lt;/span&gt;&lt;span class="kwrd"&gt;="Gold"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xs:enumeration&lt;/span&gt; &lt;span class="attr"&gt;value&lt;/span&gt;&lt;span class="kwrd"&gt;="Platinum"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xs:enumeration&lt;/span&gt; &lt;span class="attr"&gt;value&lt;/span&gt;&lt;span class="kwrd"&gt;="Adamantium"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;xs:restriction&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;  &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;xs:simpleType&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xs:complexType&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="ArrayOfString"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xs:sequence&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xs:element&lt;/span&gt; &lt;span class="attr"&gt;minOccurs&lt;/span&gt;&lt;span class="kwrd"&gt;="0"&lt;/span&gt; &lt;span class="attr"&gt;maxOccurs&lt;/span&gt;&lt;span class="kwrd"&gt;="unbounded"&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="string"&lt;/span&gt; &lt;span class="attr"&gt;nillable&lt;/span&gt;&lt;span class="kwrd"&gt;="true"&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;="xs:string"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;xs:sequence&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;  &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;xs:complexType&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;xs:schema&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;C.  From Xsd to .java - Into the Breach!&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The Java utility for working with schemas is xjc.exe.  Actually, as with all things Java, there are at least 835,234 different ways of doing this.  This is just how I do it.  YMMV.&lt;/p&gt;
&lt;p&gt;Sample command:&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;"C:\Program Files (x86)\Java\jdk1.6.0_12\bin\xjc.exe" -verbose C:\Zen\Schemas\schema0.xsd -p com.zendoodle.customer&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;This will generate .java source code classes.  Which is great, &lt;strong&gt;&lt;font size="3"&gt;but you must make one modification!&lt;/font&gt;&lt;/strong&gt; And that is to identify the XmlRootElement by name.  I've highlighted the two lines of code that you have to add below in &lt;strong&gt;&lt;font color="#ff0000"&gt;bold red&lt;/font&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;font face=""&gt;//&lt;br /&gt;
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6 &lt;br /&gt;
// See &amp;lt;a href="http://java.sun.com/xml/jaxb"&amp;gt;http://java.sun.com/xml/jaxb&amp;lt;/a&amp;gt; &lt;br /&gt;
// Any modifications to this file will be lost upon recompilation of the source schema. &lt;br /&gt;
// Generated on: 2009.05.04 at 08:59:01 PM EDT &lt;br /&gt;
//&lt;/font&gt;&lt;/p&gt;
&lt;font face=""&gt;
&lt;p&gt;&lt;br /&gt;
package com.zendoodle.customer;&lt;/p&gt;
&lt;p&gt;import javax.xml.bind.annotation.XmlAccessType;&lt;br /&gt;
import javax.xml.bind.annotation.XmlAccessorType;&lt;br /&gt;
import javax.xml.bind.annotation.XmlElement;&lt;br /&gt;
import javax.xml.bind.annotation.XmlType;&lt;br /&gt;
&lt;font color="#ff0000"&gt;&lt;strong&gt;import javax.xml.bind.annotation.XmlRootElement;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;/**&lt;br /&gt;
 * &amp;lt;p&amp;gt;Java class for Customer complex type.&lt;br /&gt;
 * &lt;br /&gt;
 * &amp;lt;p&amp;gt;The following schema fragment specifies the expected content contained within this class.&lt;br /&gt;
 * &lt;br /&gt;
 * &amp;lt;pre&amp;gt;&lt;br /&gt;
 * &amp;amp;lt;complexType name="Customer"&amp;gt;&lt;br /&gt;
 *   &amp;amp;lt;complexContent&amp;gt;&lt;br /&gt;
 *     &amp;amp;lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&amp;gt;&lt;br /&gt;
 *       &amp;amp;lt;sequence&amp;gt;&lt;br /&gt;
 *         &amp;amp;lt;element name="Name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&amp;gt;&lt;br /&gt;
 *         &amp;amp;lt;element name="Address" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&amp;gt;&lt;br /&gt;
 *         &amp;amp;lt;element name="City" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&amp;gt;&lt;br /&gt;
 *         &amp;amp;lt;element name="State" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&amp;gt;&lt;br /&gt;
 *         &amp;amp;lt;element name="PostalCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&amp;gt;&lt;br /&gt;
 *         &amp;amp;lt;element name="TypeOfCustomer" type="{http://zendoodle.com/messaging/XML-Schema/2009}CustomerType"/&amp;gt;&lt;br /&gt;
 *         &amp;amp;lt;element name="Messages" type="{http://zendoodle.com/messaging/XML-Schema/2009}ArrayOfString" minOccurs="0"/&amp;gt;&lt;br /&gt;
 *       &amp;amp;lt;/sequence&amp;gt;&lt;br /&gt;
 *     &amp;amp;lt;/restriction&amp;gt;&lt;br /&gt;
 *   &amp;amp;lt;/complexContent&amp;gt;&lt;br /&gt;
 * &amp;amp;lt;/complexType&amp;gt;&lt;br /&gt;
 * &amp;lt;/pre&amp;gt;&lt;br /&gt;
 * &lt;br /&gt;
 * &lt;br /&gt;
 */&lt;br /&gt;
&lt;strong&gt;&lt;font color="#ff0000"&gt;@XmlRootElement(name="Customer")&lt;br /&gt;
&lt;/font&gt;&lt;/strong&gt;@XmlAccessorType(XmlAccessType.FIELD)&lt;br /&gt;
@XmlType(name = "Customer", propOrder = {&lt;br /&gt;
    "name",&lt;br /&gt;
    "address",&lt;br /&gt;
    "city",&lt;br /&gt;
    "state",&lt;br /&gt;
    "postalCode",&lt;br /&gt;
    "typeOfCustomer",&lt;br /&gt;
    "messages"&lt;br /&gt;
})&lt;br /&gt;
public class Customer {&lt;/p&gt;
&lt;p&gt;    @XmlElement(name = "Name")&lt;br /&gt;
    protected String name;&lt;br /&gt;
    @XmlElement(name = "Address")&lt;br /&gt;
    protected String address;&lt;br /&gt;
    @XmlElement(name = "City")&lt;br /&gt;
    protected String city;&lt;br /&gt;
    @XmlElement(name = "State")&lt;br /&gt;
    protected String state;&lt;br /&gt;
    @XmlElement(name = "PostalCode")&lt;br /&gt;
    protected String postalCode;&lt;br /&gt;
    @XmlElement(name = "TypeOfCustomer", required = true)&lt;br /&gt;
    protected CustomerType typeOfCustomer;&lt;br /&gt;
    @XmlElement(name = "Messages")&lt;br /&gt;
    protected ArrayOfString messages;&lt;/p&gt;
&lt;p&gt;    /**&lt;br /&gt;
     * Gets the value of the name property.&lt;br /&gt;
     * &lt;br /&gt;
     * @return&lt;br /&gt;
     *     possible object is&lt;br /&gt;
     *     {@link String }&lt;br /&gt;
     *     &lt;br /&gt;
     */&lt;br /&gt;
    public String getName() {&lt;br /&gt;
        return name;&lt;br /&gt;
    }&lt;/p&gt;
&lt;p&gt;    /**&lt;br /&gt;
     * Sets the value of the name property.&lt;br /&gt;
     * &lt;br /&gt;
     * @param value&lt;br /&gt;
     *     allowed object is&lt;br /&gt;
     *     {@link String }&lt;br /&gt;
     *     &lt;br /&gt;
     */&lt;br /&gt;
    public void setName(String value) {&lt;br /&gt;
        this.name = value;&lt;br /&gt;
    }&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;D.  Compile/JAR.&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Last thing you have to do for the setup is to compile the .java classes into .class files, and then pack them into a .jar file.  This is so that your set of .class files can be easily referenced.  Include the .jar file in the Build Path of the Java application.&lt;/p&gt;
&lt;p&gt;Sample command:&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;"C:\Program Files (x86)\Java\jdk1.6.0_12\bin\javac.exe" com\zendoodle\customer\*.java&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;"C:\Program Files (x86)\Java\jdk1.6.0_12\bin\jar.exe" cfv customer.jar com\zendoodle\customer\*.class&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;Pause&lt;/font&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; After that, you should be able to move objects with their data back and forth between .NET and Java.  And for crying out oud, if you're ever going to do this more than once, automate it!  &lt;/p&gt;
&lt;p&gt;Next time we'll take a look at the queue, and how all the pieces will fit together.  If you love weird and nifty stuff, see you then!&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;/font&gt;&lt;img src="http://theruntime.com/blogs/danastevens/aggbug/2789.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Dana Stevens</dc:creator>
            <guid>http://theruntime.com/blogs/danastevens/archive/2009/05/05/drools-on-windows-part-3-of-22---object-interop.aspx</guid>
            <pubDate>Tue, 05 May 2009 23:13:13 GMT</pubDate>
            <comments>http://theruntime.com/blogs/danastevens/archive/2009/05/05/drools-on-windows-part-3-of-22---object-interop.aspx#feedback</comments>
            <slash:comments>30</slash:comments>
            <wfw:commentRss>http://theruntime.com/blogs/danastevens/comments/commentRss/2789.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Drools on Windows (Part 2 of 22) - Installation</title>
            <category>Drools</category>
            <category>Java</category>
            <link>http://theruntime.com/blogs/danastevens/archive/2009/02/21/drools-on-windows-part-2-of-22---installation.aspx</link>
            <description>&lt;p&gt;&lt;font face="Arial"&gt;Setup of a Drools development environment is fairly straightforward.  (For a Java app.) For this exercise, I'm going to kick open Microsoft Virtual PC 2007, and start with a new instance of Windows XP Pro SP3.  &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;First, install Java.  &lt;a style="TEXT-DECORATION: underline" target="_blank" href="http://www.java.com/getjava/"&gt;Go to the Get Java link&lt;/a&gt;, and install the latest version, which at the time of this writing is Version 6 Update 12.  Depending on your browser settings, you might have to download the file (jxpiinstall-6u12-fcs-bin-b04-windows-i586-17_jan_2009.exe) and run it locally.  Whatever.  The point is to step out and get Java on your machine.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Second, install the &lt;a style="TEXT-DECORATION: underline" target="_blank" href="http://www.eclipse.org/downloads/"&gt;Eclipse IDE for Java EE Developers&lt;/a&gt;.  It's 163Mb, and I must say a very nice and robust IDE.  It has several nifty features that I wish Visual Studio had.  &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Here's something of a surprise.  It's an xcopy deployment.  You download the file, unzip it, and copy it to where you want it to run.  I created a &lt;strong&gt;C:\Program Files\Eclipse&lt;/strong&gt; directory, and placed it there.  I also create a Desktop shortcut and also pin the shortcut to the Start menu.  &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;The first time you run Eclipse, it asks you to designate a workspace. The workspace is your projects folder.  Then you get the welcome page.  There is an Overview, What's New, Samples, Tutorials, and the Workbench.  The Workbench is, unsurprisingly, where you do the work.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Next, time to get a rules engine.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Drools is part of the jboss 'galaxy of applications'.  jboss is probably most famous for their Application Server, which I hear is quite popular in some development communities.  jboss is a division of Red Hat, and you can see a nice graphical overview of their many projects &lt;a style="TEXT-DECORATION: underline" target="_blank" href="http://www.jboss.org/projects/ "&gt;here&lt;/a&gt;.    But I don't need all that stuff, of course, I'm just interested in the free rules engine.  I should note that you can get enterprise-level support agreements from Red Hat for Drools.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Navigate to the &lt;a style="TEXT-DECORATION: underline" target="_blank" href="http://www.jboss.org/drools/downloads.html"&gt;Drools download page&lt;/a&gt;, and you'll see a few versions of Drools there.  I'm going to download &lt;strong&gt;5.0.0.M5&lt;/strong&gt;, or Version 5 Milestone 5, and use that.  There are nine files available; I just download them all.  Broadband is awesome.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;From &lt;strong&gt;drools-5.0.0.M5-eclipse-all&lt;/strong&gt;, take the four files from the &lt;strong&gt;plugins&lt;/strong&gt; subdirectory, and copy them to the Eclipse plugins folder.  Mine is at C:\Program Files\Eclipse\plugins\.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Next from &lt;strong&gt;drools-5.0.0.M5-eclipse-all&lt;/strong&gt;, take the three subdirectories under &lt;strong&gt;features&lt;/strong&gt; and copy them to the Eclipse features folder.  For me that's C:\Program Files\Eclipse\features\.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Then restart Eclipse, and go to the Workbench.  Right-click in the Project Explorer, and select New... Project.  You'll get a wizard, with the first dialog being a listing of all the possible project types, and Drools should be listed, as below:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="Eclipse New Project Wizard" src="http://theruntime.com/blogs/images/theruntime_com/blogs/danastevens/400/o_Drools_NewProjectWizard.gif" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Select the Drools Project type.  Click Next.  Type in a Project name; I used &lt;strong&gt;DroolsApp1&lt;/strong&gt;.  Next.  Next.  Ah, here we are at the Drools Runtime dialog.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;strong&gt;&lt;u&gt;There's No Drools Runtime Like My Drools Runtime.&lt;/u&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;The Drools Runtime can be defined as: the set of jar files necessary to run Drools. Straightforward, right?  Eh, in a word, no.  There are numerous ways you can assemble this set of files, depending on how you intend to configure your production deployment and the specific set of functionality you intend to provide your users.  For example, if you are never going to allow your users to load in rules from Excel spreadsheets, then you don't need jxl-2.4.2. If you are only going to be using the DRL to define rules, and you won't be storing rules in Xml files, then you don't need xml-apis-1.0.b2.  Yeah, baby, that's the love in Javaland.  It's &lt;em&gt;all&lt;/em&gt; up to you.  These dependencies are outlined in the README_DEPENDENCIES.txt file.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;What I recommend for this exercise is simple, however.  &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Go back to the files we downloaded from jboss.org.  We'll be using &lt;strong&gt;drools-5.0.0.M5-bin.zip&lt;/strong&gt;.  Extract that, and place it somewhere on the file system.  I put it at C:\drools-5.0.0.M5-bin\.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Take all the files in C:\drools-5.0.0.M5-bin\lib\*.* and copy them up to C:\drools-5.0.0.M5-bin\*.*.  That'll work for now.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Back to the show...&lt;br /&gt;
The first time you create a Drools project in Eclipse, it asks where the Drools runtime is located.  You'll need to provide that.  &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;In the project wizard, click on the Configure Workspace Settings... link.  It will open the Eclipse preferences pane where you specify the location of the Drools runtime.  You can actually have a listing of multiple runtimes, and select different ones for different projects.  I just have the one runtime.  I name it &lt;strong&gt;Drools M5 Runtime&lt;/strong&gt; and browse to C:\drools-5.0.0.M5-bin.  Check the box.  Finish out of the wizard.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;And voila.  You should have DroolsApp1 in your Eclipse Project Explorer. It should look like this:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;/font&gt; &lt;img alt="Eclipse Package Explorer" src="http://theruntime.com/blogs/images/theruntime_com/blogs/danastevens/400/o_DroolsApp1_Project_Structure.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Run it by hitting Ctrl+F11, or click the little green right arrow. If it asks, run it as a Java Application.  Or you could click Alt+Shift+X, then J.  Seriously.  &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;You should see the output in the Console pane at the bottom of your IDE.  If it says "Hello World {CR}{LF} Goodbye cruel world" then congratulations. You are now a rules engine developer.  Immediately raise your rate by 9.35%.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Next post will take a closer look at the elements of this sample app, and postulate how the overall enterprise might look.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Link for future reference: &lt;a style="TEXT-DECORATION: underline" target="_blank" href="http://www.jboss.org/drools/"&gt;Drools home page&lt;/a&gt;.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;img src="http://theruntime.com/blogs/danastevens/aggbug/2753.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Dana Stevens</dc:creator>
            <guid>http://theruntime.com/blogs/danastevens/archive/2009/02/21/drools-on-windows-part-2-of-22---installation.aspx</guid>
            <pubDate>Sun, 22 Feb 2009 04:17:27 GMT</pubDate>
            <comments>http://theruntime.com/blogs/danastevens/archive/2009/02/21/drools-on-windows-part-2-of-22---installation.aspx#feedback</comments>
            <slash:comments>135</slash:comments>
            <wfw:commentRss>http://theruntime.com/blogs/danastevens/comments/commentRss/2753.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Drools on Windows (Part 1 of 22) - Introduction/Motivation</title>
            <category>Drools</category>
            <category>Java</category>
            <link>http://theruntime.com/blogs/danastevens/archive/2009/02/21/drools-on-windows-part-1-of-22---introductionmotivation.aspx</link>
            <description>&lt;font face="Arial"&gt;
&lt;p&gt;&lt;font face="Arial"&gt;So I admit to you right from the start: this is something of an odd journey to undertake.  Speaking with colleagues over the years, my own experience is that most developers raise an eyebrow and cast a wary eye toward anything labeled a 'rules engine'.  And in fact, it does take a very specific set of requirements to lead to the conclusion that a rules engine is appropriate.  &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;a style="TEXT-DECORATION: underline" target="_blank" href="http://www.jessrules.com/jess/guidelines.shtml"&gt;This dude&lt;/a&gt; and &lt;a style="TEXT-DECORATION: underline" target="_blank" href="http://www.gandalf-lab.com/blog/2006/08/rule-based-systems-why-use-rules.html"&gt;this other dude&lt;/a&gt; supply a good summary of why an organization might decide on going with a rules engine.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;So once you decide a rules engine is an appropriate solution, and you pencil that into the sketch of the enterprise, what next?&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;The big dogs in the Business Rules Management System space cost real money.  I'm talking &lt;a style="TEXT-DECORATION: underline" target="_blank" href="http://www.one-77.com/rear.html"&gt;Aston Martin&lt;/a&gt; money.  And they're very nice, with bells and whistles galore.  And if your budget can handle it, then you'll want to check them out.  (Here's a hint. There's no shopping cart and checkout page on their web sites.) &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;But where's the fun in that?  Let's look at the free stuff.  While my career has been solidly grounded in Microsoft technologies, I'm willing to look to &lt;a style="TEXT-DECORATION: underline" target="_blank" href="http://www.ubergeek.tv/article.php?pid=54"&gt;open source&lt;/a&gt; for solutions where it makes sense. And besides being a very robust and performant ReteOO-based rules engine, Drools happens to be free.  &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;So this series, over the course of the next 20-something blog posts, will document this entire journey step by step.  It begins with no pre-requisites, and will end with a Drools rules engine as part of a .NET enterprise solution, being called by multiple .NET and Java applications, all while running on the Windows platform.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;I think it'll be fun.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;/font&gt;&lt;img src="http://theruntime.com/blogs/danastevens/aggbug/2751.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Dana Stevens</dc:creator>
            <guid>http://theruntime.com/blogs/danastevens/archive/2009/02/21/drools-on-windows-part-1-of-22---introductionmotivation.aspx</guid>
            <pubDate>Sat, 21 Feb 2009 07:28:39 GMT</pubDate>
            <comments>http://theruntime.com/blogs/danastevens/archive/2009/02/21/drools-on-windows-part-1-of-22---introductionmotivation.aspx#feedback</comments>
            <slash:comments>86</slash:comments>
            <wfw:commentRss>http://theruntime.com/blogs/danastevens/comments/commentRss/2751.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Nifty Internet Site #89742 (http://drop.io)</title>
            <category>Misc - Tech</category>
            <category>Webby Stuff</category>
            <link>http://theruntime.com/blogs/danastevens/archive/2008/09/25/nifty-internet-site-89742-httpdrop.io.aspx</link>
            <description>&lt;p&gt;I was looking for an incoming fax service, and found this site, which offers incoming fax and a few other nifty things, for free.  I can't say the incoming fax is business-grade reliable (yet) as they're still working out the kinks, but I hope they can get it all sorted out because the concept is really groovy.  Check them out at &lt;a href="http://drop.io"&gt;http://drop.io&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;eFax still offers a free incoming fax service, but you have to use their software to read the faxes.  It's located here:  &lt;a target="_blank" href="https://www.efax.com/en/efax/twa/signupFree?rqcp=2"&gt;&lt;font face="Arial"&gt;http://www.efax.com/efax-free&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This is why the Internet is cool.&lt;/p&gt;&lt;img src="http://theruntime.com/blogs/danastevens/aggbug/2688.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Dana Stevens</dc:creator>
            <guid>http://theruntime.com/blogs/danastevens/archive/2008/09/25/nifty-internet-site-89742-httpdrop.io.aspx</guid>
            <pubDate>Thu, 25 Sep 2008 16:42:14 GMT</pubDate>
            <comments>http://theruntime.com/blogs/danastevens/archive/2008/09/25/nifty-internet-site-89742-httpdrop.io.aspx#feedback</comments>
            <slash:comments>6</slash:comments>
            <wfw:commentRss>http://theruntime.com/blogs/danastevens/comments/commentRss/2688.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Krakadiska - Sounds of the MacBook Pro</title>
            <category>Misc - Tech</category>
            <link>http://theruntime.com/blogs/danastevens/archive/2008/09/22/krakadiska---sounds-of-the-macbook-pro.aspx</link>
            <description>&lt;p&gt;I'm still lovin' the MacBook Pro, and having fun with it.  However, there's one thing that I didn't expect, and that was the surprisingly noisy slot-loading optical drive.  The first time I loaded a disc into it, it went Snap! Izzz!  Whirrr!  CLICK! Snap!  I honestly wondered if it had cracked the disc in half.  Was I going to have to pick out the pieces of a shredded DVD with needle-nose pliers?  But no --- this is a feature.   The other slot-loaders I've had, mostly CD players, load a disk is near silence, with perhaps only a muted click, and soft spin-up.   (But then, perhaps the violent snapping noises enable super-precise positioning for ultra-accurate DVD burning and reading.  How have other drives performed for all these years without them?  Who knows?)&lt;/p&gt;
&lt;p&gt;What I do know is that Apple actually posted &lt;a href="http://support.apple.com/kb/HT1723?viewlocale=en_US"&gt;the sounds of the MacBook Pro.&lt;/a&gt;  So you can listen before you buy.  Now that's thinking different.&lt;/p&gt;&lt;img src="http://theruntime.com/blogs/danastevens/aggbug/2686.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Dana Stevens</dc:creator>
            <guid>http://theruntime.com/blogs/danastevens/archive/2008/09/22/krakadiska---sounds-of-the-macbook-pro.aspx</guid>
            <pubDate>Mon, 22 Sep 2008 16:42:58 GMT</pubDate>
            <comments>http://theruntime.com/blogs/danastevens/archive/2008/09/22/krakadiska---sounds-of-the-macbook-pro.aspx#feedback</comments>
            <slash:comments>7</slash:comments>
            <wfw:commentRss>http://theruntime.com/blogs/danastevens/comments/commentRss/2686.aspx</wfw:commentRss>
        </item>
        <item>
            <title>I'm a PC . . . but I bought a Mac.</title>
            <link>http://theruntime.com/blogs/danastevens/archive/2008/09/22/im-a-pc-.-.-.-but-i-bought-a.aspx</link>
            <description>&lt;p&gt;First, a brief historical interlude.  My first paying job in the computer industry was at a computer retailer in Tampa, Florida.  It was a small company with eleven employees, two store locations, and we built and sold clones, set up small networks, and enjoyed the high margins that a hardware retailer could get (20% and up!) back in the early 1990s.  Like at many small companies, we all did it all, and wore every hat there was to wear.  It was a fabulous time in the industry, and I developed an affinity for hardware tech.  I never got tired of building machines and troubleshooting hardware issues.  And even after many years now, I still love the hardware and still build my own rigs.  &lt;/p&gt;  &lt;p&gt;I’ve gone through a number of notebook computers, and for me, the first question to consider when buying a notebook is: Do I want a smaller notebook with long battery life, or do I want big screen and horsepower (with the understanding that battery life might equal 25 minutes)?&lt;/p&gt;  &lt;p&gt;My last notebook was a big Sony Vaio.  I made the decision that I wanted something in the 'desktop replacement' class, and it was heavy, large, and battery life was around 30 minutes.  and while I really liked the Sony hardware, the overall experience I had with the notebook was miserable.  The notebook came with no disks at all, and so I had to burn my own driver-backup disks.  Yuk.  Plus, when I actually needed them, months later, the disks didn’t work, and I had to call up Sony, where they cheerfully told me that I could order a set of disks for $99.  Nice.  Anyway, I used that notebook for a year and a half, sold it, and was 'without notebook' for a while.&lt;/p&gt;  &lt;p&gt;Last week, I decided it was time to get portable again. I wanted something smaller this time, but still with enough juice for Visual Studio.  I had heard from quite a few developers that really liked the MacBook Pro, running Boot Camp/VM Fusion/Parallels in order to load Vista and (the all-important aforementioned) Visual Studio).  The machines certainly look cool, but is that enough to justify the premium?  To check it out, I went to Best Buy and tinkered with all the notebooks . . . which is an enjoyable afternoon all unto itself.  Then I plunked down my two large on the MacBook Pro 15.4" model. (My path to the dark side was complete!)&lt;/p&gt;  &lt;p&gt;I must report that I really like this machine.  Not to get existential, but Apple just gets it.  After messing around with OS X, which is nifty, I partitioned the drive for Vista, installed that OS, and wondered how bad the driver situation would be.  After installing Vista, I inserted the Apple CD, and Vista immediately recognized setup.exe, ran it, which installed the Boot Camp software on Vista, along with all the drivers - - - even the ones that control the keyboard backlighting.  That’s just cool.  Wifi works, Bluetooth works . . . it all just works.  Dang, just like the slogan.  Credit where credit is due: the boys from Cupertino design a good notebook.&lt;/p&gt;  &lt;p&gt;For a mouse, I picked up the Logitech VX Nano.  I use the MX Revolution when I code, and I just love the heavy, metal scroll wheel.  That’s the best feature I’ve found yet on a mouse, and the VX Nano has a scroll wheel just like his big brother.&lt;/p&gt;  &lt;p&gt;All in all, I am one extremely satisfied customer. Now I’m wondering if I’ll ever buy anything except an Intel-based Apple notebook.  They rule.  &lt;/p&gt;  &lt;p&gt;And as a historical observation, the camps of Apple Fanboys and the camps of Microsoft Fanboys were once clearly delineated.  It’s interesting that in recent years the lines of demarcation have blurred . . . to the point where Windows developers buy Apple notebooks to run Visual Studio on a Windows OS inside OS X to build code that gets deployed to Windows Server machines.&lt;/p&gt;&lt;img src="http://theruntime.com/blogs/danastevens/aggbug/2685.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Dana Stevens</dc:creator>
            <guid>http://theruntime.com/blogs/danastevens/archive/2008/09/22/im-a-pc-.-.-.-but-i-bought-a.aspx</guid>
            <pubDate>Mon, 22 Sep 2008 05:40:38 GMT</pubDate>
            <comments>http://theruntime.com/blogs/danastevens/archive/2008/09/22/im-a-pc-.-.-.-but-i-bought-a.aspx#feedback</comments>
            <slash:comments>8</slash:comments>
            <wfw:commentRss>http://theruntime.com/blogs/danastevens/comments/commentRss/2685.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Essential utility - visionapp Remote Desktop</title>
            <link>http://theruntime.com/blogs/danastevens/archive/2008/08/27/essential-utility---visionapp-remote-desktop.aspx</link>
            <description>&lt;p&gt;Like many developers, I spend quite a bit of my day RDP’ed into some virtual server or other. Even with dual monitors, it can become annoying to flip between sessions.  So then I got a tip about this very nifty utility, and now I couldn’t get along without it.&lt;/p&gt;  &lt;p&gt;Made by visionapp, it’s called vRD.  They have a free version, and one that’s $69.00, or slightly more if you want upgrade maintenance &amp;amp; support.  I use the freebie.&lt;/p&gt;  &lt;p&gt;You can store your credentials if you want to, categorize your server list in a nice treeview, and the app presents your sessions in a really nice tabbed interface...&lt;/p&gt;  &lt;p&gt;Good stuff.&lt;/p&gt;  &lt;p&gt;&lt;a title="http://www.visionapp.com/141.0.html" href="http://www.visionapp.com/141.0.html"&gt;http://www.visionapp.com/141.0.html&lt;/a&gt;  &lt;/p&gt;  &lt;p&gt;Scroll to the bottom; you’ll see a listing for &lt;strong&gt;&lt;b&gt;visionapp Remote Desktop (vRD 1.5) - Freeware.  Registration is required.&lt;/b&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Disclaimer: Not affiliated in any way with visionapp.  They don’t even know me.&lt;/p&gt;&lt;img src="http://theruntime.com/blogs/danastevens/aggbug/2668.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Dana Stevens</dc:creator>
            <guid>http://theruntime.com/blogs/danastevens/archive/2008/08/27/essential-utility---visionapp-remote-desktop.aspx</guid>
            <pubDate>Thu, 28 Aug 2008 03:13:23 GMT</pubDate>
            <comments>http://theruntime.com/blogs/danastevens/archive/2008/08/27/essential-utility---visionapp-remote-desktop.aspx#feedback</comments>
            <slash:comments>24</slash:comments>
            <wfw:commentRss>http://theruntime.com/blogs/danastevens/comments/commentRss/2668.aspx</wfw:commentRss>
        </item>
        <item>
            <title>SQL Quick Tip - Determine data type of column.</title>
            <link>http://theruntime.com/blogs/danastevens/archive/2008/08/13/sql-quick-tip---determine-data-type-of-column.aspx</link>
            <description>&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&lt;font face="Verdana" color="#000000"&gt;Use the very nifty SQL_VARIANT_PROPERTY to determine the data type of a returned column.  &lt;/font&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&lt;font face="Verdana" color="#000000"&gt;Admittedly, it’s faster to look at the table definition in SSMS.  But this is pretty neat.&lt;/font&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="csharpcode"&gt; &lt;/pre&gt;
&lt;table cellspacing="0" cellpadding="2" width="596" border="1"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="594"&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;DECLARE&lt;/span&gt; @TableVar &lt;span class="kwrd"&gt;TABLE&lt;/span&gt; (MyColumn &lt;span class="kwrd"&gt;numeric&lt;/span&gt;(18,5)) 

&lt;font color="#0000ff"&gt;INSERT&lt;/font&gt; &lt;span class="kwrd"&gt;INTO&lt;/span&gt; @TableVar &lt;span class="kwrd"&gt;VALUES&lt;/span&gt; (5.5) 

&lt;span class="kwrd"&gt;SELECT&lt;/span&gt; &lt;span class="kwrd"&gt;TOP&lt;/span&gt; 1 
     MyColumn, 
     &lt;font color="#ff0080"&gt;SQL_VARIANT_PROPERTY&lt;/font&gt;(MyColumn, &lt;span class="str"&gt;&lt;font color="#ff0000"&gt;'BaseType'&lt;/font&gt;&lt;/span&gt;) &lt;span class="kwrd"&gt;AS&lt;/span&gt; &lt;span class="str"&gt;&lt;font color="#ff0000"&gt;'Base_Type'&lt;/font&gt;&lt;/span&gt;, 
     &lt;font color="#ff0080"&gt;SQL_VARIANT_PROPERTY&lt;/font&gt;(MyColumn, &lt;span class="str"&gt;&lt;font color="#ff0000"&gt;'Precision'&lt;/font&gt;&lt;/span&gt;) &lt;span class="kwrd"&gt;AS&lt;/span&gt; &lt;span class="str"&gt;&lt;font color="#ff0000"&gt;'Precision'&lt;/font&gt;&lt;/span&gt;, 
     &lt;font color="#ff0080"&gt;SQL_VARIANT_PROPERTY&lt;/font&gt;(MyColumn, &lt;span class="str"&gt;&lt;font color="#ff0000"&gt;'Scale'&lt;/font&gt;&lt;/span&gt;) &lt;span class="kwrd"&gt;AS&lt;/span&gt; &lt;font color="#ff0000"&gt;&lt;span class="str"&gt;'Scale'&lt;/span&gt; &lt;/font&gt;
&lt;span class="kwrd"&gt;FROM&lt;/span&gt; @TableVar 

&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;style type="text/css"&gt;&lt;![CDATA[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; }
]]&gt;&lt;/style&gt;
&lt;/table&gt;
&lt;style type="text/css"&gt;&lt;![CDATA[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; }
]]&gt;&lt;/style&gt;&lt;img src="http://theruntime.com/blogs/danastevens/aggbug/2661.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Dana Stevens</dc:creator>
            <guid>http://theruntime.com/blogs/danastevens/archive/2008/08/13/sql-quick-tip---determine-data-type-of-column.aspx</guid>
            <pubDate>Wed, 13 Aug 2008 04:03:06 GMT</pubDate>
            <comments>http://theruntime.com/blogs/danastevens/archive/2008/08/13/sql-quick-tip---determine-data-type-of-column.aspx#feedback</comments>
            <slash:comments>19</slash:comments>
            <wfw:commentRss>http://theruntime.com/blogs/danastevens/comments/commentRss/2661.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>