<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:odc="urn:schemas-microsoft-com:office:odc" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rtc="http://microsoft.com/officenet/conferencing" xmlns:D="DAV:" xmlns:Repl="http://schemas.microsoft.com/repl/" xmlns:mt="http://schemas.microsoft.com/sharepoint/soap/meetings/" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ppda="http://www.passport.com/NameSpace.xsd" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sub="http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/" xmlns:ec="http://www.w3.org/2001/04/xmlenc#" xmlns:sp="http://schemas.microsoft.com/sharepoint/" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udcs="http://schemas.microsoft.com/data/udc/soap" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:udcp2p="http://schemas.microsoft.com/data/udc/parttopart" xmlns:wf="http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:dsss="http://schemas.microsoft.com/office/2006/digsig-setup" xmlns:dssi="http://schemas.microsoft.com/office/2006/digsig" xmlns:mdssi="http://schemas.openxmlformats.org/package/2006/digital-signature" xmlns:mver="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:mrels="http://schemas.openxmlformats.org/package/2006/relationships" xmlns:spwp="http://microsoft.com/sharepoint/webpartpages" xmlns:ex12t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ex12m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:pptsl="http://schemas.microsoft.com/sharepoint/soap/SlideLibrary/" xmlns:spsl="http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService" xmlns:Z="urn:schemas-microsoft-com:" xmlns:st="" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Monaco;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:862062333;
        mso-list-type:hybrid;
        mso-list-template-ids:-567091636 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-text:"%1\)";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=WordSection1>
<p class=MsoNormal>Hello,<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>I’ve only been working with Drools for a little over a
month or so now and I’ve begun integrating it into my application via
Eclipse and creating DRL files. The nature of this application is to take
a data record from one file and create a new data record in another file.
This is done in a batch of any number of records, depending on the number of
records sent to us in the first file. To accomplish this I have two classes,
one representing each file, and I create and object for each of them, inserting
them into the knowledge session and then fire the rule. <o:p></o:p></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-family:Monaco;
color:black'><o:p> </o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-family:Monaco;
color:black'> ksession.insert(myObjectIn);</span><span
style='font-family:Monaco'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-family:Monaco;
color:black'> ksession.insert(myObjectOut);</span><span
style='font-family:Monaco'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-family:Monaco;
color:black'> ksession.fireAllRules();</span><span
style='font-family:Monaco'><o:p></o:p></span></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>The first object has around 1,000 fields and the second has
250, so my class structure is quite broad.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>In a DRL file I have created the following rule:<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal style='text-autospace:none'><b><span style='font-family:
Monaco;color:#960000'>rule</span></b><span style='font-family:Monaco;
color:black'> </span><span style='font-family:Monaco;color:green'>"Primary
Diagnosis Code"</span><span style='font-family:Monaco'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-family:Monaco;
color:black'> </span><b><span style='font-family:Monaco;
color:#960000'>when</span></b><span style='font-family:Monaco'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-family:Monaco;
color:black'> $ccl
: anObjectIn(IncomingDiag1 != </span><b><span style='font-family:Monaco;
color:#960000'>null</span></b><span style='font-family:Monaco;color:black'>)</span><span
style='font-family:Monaco'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-family:Monaco;
color:black'> $cdl
: anObjectOut()</span><span style='font-family:Monaco'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-family:Monaco;
color:black'> </span><b><span style='font-family:Monaco;
color:#960000'>then</span></b><span style='font-family:Monaco;color:black'> </span><span
style='font-family:Monaco'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-family:Monaco;
color:black'> $cdl.PrimaryDiag
= $ccl.IncomingDiag1;</span><span style='font-family:Monaco'><o:p></o:p></span></p>
<p class=MsoNormal><b><span style='font-family:Monaco;color:#960000'>end</span></b><o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>This rule fires great and the PrimaryDiag field in myObjectOut
is updated with what iss in myObjectIn.<span style='font-family:Monaco;
color:black'>IncomingDiag</span>. I can then write the object back out
the the database fine.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>A requirement of my project is that I allow users (analysts)
to create their own rules that are above and beyond those I might create in a
.drl file. To do so we are looking to deploy Guvnor and let them use the Guided
editor to create rules. I’ve already loaded my fact models into
Guvnor and have them available in the drop down conditions.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>The questions that are hitting me now are:<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span
style='mso-list:Ignore'>1)<span style='font:7.0pt "Times New Roman"'>
</span></span><![endif]>On the LHS when I’ve chosen the fiels
IncomingDiag the only options I have for conditions are “equal to”,
“not equal to”, “matches”, and “sounds like”.
I don’t see an option for null or notnull. If I were to choose “not
equal to” I then have the options for Literal Values, New Formulas, or
Expression Editor (which has none by default). I haven’t seen any
examples where someone is evaluating a field in Guvnor for being either “”
or null. How would one accomplish this? The literal value does not
allow you to leave it blank as in “” and if you type “”
in it, the source shows “”””.<o:p></o:p></p>
<p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span
style='mso-list:Ignore'>2)<span style='font:7.0pt "Times New Roman"'>
</span></span><![endif]>On the LHS, if I were to want to evaluate IncomingDiag1
== IncomingDiag2 I don’t see a method except if I were to choose New
Formula and type in the field name Incoming Diag2. Is there another way
that they could be prompted for the field choises again?<o:p></o:p></p>
<p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span
style='mso-list:Ignore'>3)<span style='font:7.0pt "Times New Roman"'>
</span></span><![endif]>On the RHS, when I go to add a new then, I’m
prompted to choose only to either “insert fact <span style='font-family:
Monaco;color:black'>anObjectIn</span>” or to “logically insert fact
<span style='font-family:Monaco;color:black'>anObjectIn</span>” or to
manually enter DRL logic. Both of the inserts appear to create logic that
would create a new object with the data in it:<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal style='margin-left:.25in'><span style='font-family:Monaco;
color:black'>anObjectIn</span><span style='font-family:"Tahoma","sans-serif";
color:#444444'> fact0 = new </span><span style='font-family:Monaco;color:black'>anObjectIn</span><span
style='font-family:"Tahoma","sans-serif";color:#444444'> ();<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:.25in'><span style='font-family:"Tahoma","sans-serif";
color:#444444'>fact0.</span><span style='font-family:Monaco;color:black'> IncomingDiag1</span><span
style='font-family:"Tahoma","sans-serif";color:#444444'> ( 11 );<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:.25in'><span style='font-family:"Tahoma","sans-serif";
color:#444444'>insertLogical(fact0 );</span> <o:p></o:p></p>
<p class=MsoNormal style='margin-left:.25in'> <o:p></o:p></p>
<p class=MsoNormal style='margin-left:.25in'> But
what I really want is something similar to my DRL from above. Am I
missing something? Or would this have to be a case where they would
manually enter the DRL statement?<o:p></o:p></p>
<p class=MsoNormal style='margin-left:.25in'><o:p> </o:p></p>
<p class=MsoNormal style='margin-left:.25in'>Thank you!<o:p></o:p></p>
<p class=MsoNormal style='margin-left:.25in'><o:p> </o:p></p>
<p class=MsoNormal style='margin-left:.25in'>Dean Whisnant<o:p></o:p></p>
<p class=MsoNormal style='margin-left:.25in'>Senior Software Developer<o:p></o:p></p>
<p class=MsoNormal style='margin-left:.25in'>basys, inc.<o:p></o:p></p>
</div>
</body>
</html>