<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    For question 1, if your asking can a object matched be automatically
    set to a variable that you can later reference?&nbsp; No.&nbsp; You have to
    provide the binding else how would you know how to reference it.<br>
    <br>
    For question 2, the or part is tricky from the UI as you have to do
    the and first then or embedded in the and.&nbsp; You accomplish that via
    <b>Multiple field constraints</b>.&nbsp; So I guess you always want to
    start on the outter condition and work your way in due to the
    quirkiness of the UI.<br>
    <br>
    <img src="cid:part1.01080201.07050301@dna20.com" alt=""><br>
    <br>
    HTH<br>
    Minh<br>
    <br>
    On 10/8/2010 5:11 AM, Dean Whisnant wrote:
    <blockquote
cite="mid:86842F7EF952B940B49255CEDB657F2C20C535FEF6@Exchange07.basysnet.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <meta name="Generator" content="Microsoft Word 12 (filtered
        medium)">
      <!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
      <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:Consolas;
        panose-1:2 11 6 9 2 2 4 3 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";
        color:black;}
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;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
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";
        color:black;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@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:632714406;
        mso-list-type:hybrid;
        mso-list-template-ids:1839112246 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;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        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]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Minh,<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p>&nbsp;</o:p></span></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Thank
            you!&nbsp; The binding to
            a variable is the part I was missing in order to accomplish
            2 &amp; 3 and #1
            was as simple as using the formula to say null.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p>&nbsp;</o:p></span></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Last
            night I worked through this
            and some matching Regex issues I had.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p>&nbsp;</o:p></span></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">I do
            have two follow on
            questions if you don&#8217;t mind:<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p>&nbsp;</o:p></span></p>
        <p class="MsoListParagraph" style="text-indent: -0.25in;"><!--[if !supportLists]--><span
            style="color: rgb(31, 73, 125);"><span style="">1)<span
                style="font: 7pt &quot;Times New Roman&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
              </span></span></span><!--[endif]--><span style="color:
            rgb(31, 73, 125);">Can the binding be
            done in another way where you don&#8217;t have to set it up on
            each rule?<o:p></o:p></span></p>
        <p class="MsoListParagraph" style="text-indent: -0.25in;"><!--[if !supportLists]--><span
            style="color: rgb(31, 73, 125);"><span style="">2)<span
                style="font: 7pt &quot;Times New Roman&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
              </span></span></span><!--[endif]--><span style="color:
            rgb(31, 73, 125);">How does one go
            about creating an &#8220;or&#8221; condition here in guvnor? <o:p></o:p></span></p>
        <p class="MsoListParagraph" style="margin-left: 1in;
          text-indent: -0.25in;"><!--[if !supportLists]--><span
            style="color: rgb(31, 73, 125);"><span style="">a.<span
                style="font: 7pt &quot;Times New Roman&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
              </span></span></span><!--[endif]--><span style="color:
            rgb(31, 73, 125);">If ((string1 != null
            || &nbsp;string2 != &#8220;AB&#8221;) &nbsp;&amp;&amp; string1 != string2) then<o:p></o:p></span></p>
        <p class="MsoListParagraph" style="margin-left: 1in;
          text-indent: -0.25in;"><!--[if !supportLists]--><span
            style="color: rgb(31, 73, 125);"><span style="">b.<span
                style="font: 7pt &quot;Times New Roman&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
              </span></span></span><!--[endif]--><span style="color:
            rgb(31, 73, 125);">If (string1 == &#8220;ABC&#8221;
            || string1 ==&#8221;XYZ&#8221; | string1==&#8221;QWERTY&#8221;) then<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p>&nbsp;</o:p></span></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">These
            scenarios all seem so
            simple to me from a DRL hand coding, so I know they must be
            able to be handled in
            guvnor and I&#8217;m just missing some subtle nuance.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p>&nbsp;</o:p></span></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">I
            appreciate the help&#8230;<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p>&nbsp;</o:p></span></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Dean<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p>&nbsp;</o:p></span></p>
        <div>
          <div style="border-right: medium none; border-width: 1pt
            medium medium; border-style: solid none none; border-color:
            rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color;
            padding: 3pt 0in 0in;">
            <p class="MsoNormal"><b><span style="font-size: 10pt;
                  font-family:
                  &quot;Tahoma&quot;,&quot;sans-serif&quot;; color:
                  windowtext;">From:</span></b><span style="font-size:
                10pt; font-family:
                &quot;Tahoma&quot;,&quot;sans-serif&quot;; color:
                windowtext;"> <a class="moz-txt-link-abbreviated" href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>
                [<a class="moz-txt-link-freetext" href="mailto:rules-users-bounces@lists.jboss.org">mailto:rules-users-bounces@lists.jboss.org</a>] <b>On
                  Behalf Of </b>Minh Huon<br>
                <b>Sent:</b> Thursday, October 07, 2010 8:31 PM<br>
                <b>To:</b> Rules Users List<br>
                <b>Subject:</b> Re: [rules-users] Guvnor LHS and RHS
                questions<o:p></o:p></span></p>
          </div>
        </div>
        <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
        <p class="MsoNormal">Look at screen shot for questions 1 and 2<br>
          <br>
          <img id="_x0000_i1025"
            src="cid:part2.02050800.03040500@dna20.com" height="900"
            width="994"><br>
          <br>
          <br>
          UI is a little screwy but you can check for null.<br>
          <br>
          As for question 3, if you look at the source of your drl,
          you'll see if you
          have a named reference to your object if not, you cannot use
          it on the right
          hand side.&nbsp; If you look at my rule, I'm setting the contents
          of <b>override
          </b>to <b>resultNumberToPick </b>which is what I think your
          trying to
          accomplish.<br>
          <br>
          hth<br>
          <br>
          Minh<br>
          <br>
          <br>
          On 10/7/2010 2:15 PM, Dean Whisnant wrote: <o:p></o:p></p>
        <p class="MsoNormal">Hello,<o:p></o:p></p>
        <p class="MsoNormal">&nbsp;<o:p></o:p></p>
        <p class="MsoNormal">I&#8217;ve only been working with Drools for a
          little over a
          month or so now and I&#8217;ve begun integrating it into my
          application via
          Eclipse and creating DRL files.&nbsp; The nature of this
          application is to take
          a data record from one file and create a new data record in
          another file.&nbsp;
          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.&nbsp; <o:p></o:p></p>
        <p class="MsoNormal"><span style="font-family: Monaco;">&nbsp;</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="font-family: Monaco;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            ksession.insert(myObjectIn);</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="font-family: Monaco;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            ksession.insert(myObjectOut);</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="font-family: Monaco;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            ksession.fireAllRules();</span><o:p></o:p></p>
        <p class="MsoNormal">&nbsp;<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">&nbsp;<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">&nbsp;<o:p></o:p></p>
        <p class="MsoNormal"><b><span style="font-family: Monaco; color:
              rgb(150, 0, 0);">rule</span></b><span style="font-family:
            Monaco;"> </span><span style="font-family: Monaco; color:
            green;">"Primary
            Diagnosis Code"</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="font-family: Monaco;">&nbsp;&nbsp;&nbsp;&nbsp; </span><b><span
              style="font-family: Monaco; color: rgb(150, 0, 0);">when</span></b><o:p></o:p></p>
        <p class="MsoNormal"><span style="font-family: Monaco;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
$ccl
            : anObjectIn(IncomingDiag1 != </span><b><span
              style="font-family: Monaco; color: rgb(150, 0, 0);">null</span></b><span
            style="font-family: Monaco;">)</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="font-family: Monaco;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
$cdl&nbsp;
            : anObjectOut()</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="font-family: Monaco;">&nbsp;&nbsp;&nbsp;&nbsp; </span><b><span
              style="font-family: Monaco; color: rgb(150, 0, 0);">then</span></b><span
            style="font-family: Monaco;"> </span><o:p></o:p></p>
        <p class="MsoNormal"><span style="font-family: Monaco;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
$cdl.PrimaryDiag
            = $ccl.IncomingDiag1;</span><o:p></o:p></p>
        <p class="MsoNormal"><b><span style="font-family: Monaco; color:
              rgb(150, 0, 0);">end</span></b><o:p></o:p></p>
        <p class="MsoNormal">&nbsp;<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;">IncomingDiag</span>.&nbsp; I can
          then write the object back out the the
          database fine.<o:p></o:p></p>
        <p class="MsoNormal">&nbsp;<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.&nbsp; I&#8217;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">&nbsp;<o:p></o:p></p>
        <p class="MsoNormal">The questions that are hitting me now are:<o:p></o:p></p>
        <p class="MsoNormal">&nbsp;<o:p></o:p></p>
        <p class="MsoListParagraph" style="text-indent: -0.25in;">On the
          LHS when I&#8217;ve
          chosen the fiels IncomingDiag the only options I have for
          conditions are
          &#8220;equal to&#8221;, &#8220;not equal to&#8221;, &#8220;matches&#8221;, and
          &#8220;sounds like&#8221;. I don&#8217;t see an option for null or notnull. If I
          were to choose &#8220;not equal to&#8221; I then have the options for
          Literal
          Values, New Formulas, or Expression Editor (which has none by
          default).&nbsp; I
          haven&#8217;t seen any examples where someone is evaluating a field
          in Guvnor
          for being either &#8220;&#8221; or null.&nbsp; How would one accomplish
          this?&nbsp; The literal value does not allow you to leave it blank
          as in
          &#8220;&#8221; and if you type &#8220;&#8221; in it, the source shows
          &#8220;&#8221;&#8221;&#8221;.<o:p></o:p></p>
        <p class="MsoListParagraph" style="text-indent: -0.25in;">On the
          LHS, if I were to
          want to evaluate IncomingDiag1 == IncomingDiag2 I don&#8217;t see a
          method
          except if I were to choose New Formula and type in the field
          name Incoming
          Diag2.&nbsp; 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: -0.25in;">On the
          RHS, when I go to
          add a new then, I&#8217;m prompted to choose only to either &#8220;insert
          fact <span style="font-family: Monaco;">anObjectIn</span>&#8221; or
          to &#8220;logically insert
          fact <span style="font-family: Monaco;">anObjectIn</span>&#8221; or
          to manually
          enter DRL logic.&nbsp; 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">&nbsp;<o:p></o:p></p>
        <p class="MsoNormal" style="margin-left: 0.25in;"><span
            style="font-family: Monaco;">anObjectIn</span><span
            style="font-family:
            &quot;Tahoma&quot;,&quot;sans-serif&quot;;"> fact0 = new </span><span
            style="font-family: Monaco;">anObjectIn</span><span
            style="font-family:
            &quot;Tahoma&quot;,&quot;sans-serif&quot;;">
            ();</span><o:p></o:p></p>
        <p class="MsoNormal" style="margin-left: 0.25in;"><span
            style="font-family:
            &quot;Tahoma&quot;,&quot;sans-serif&quot;;">fact0.</span><span
            style="font-family: Monaco;"> IncomingDiag1</span><span
            style="font-family:
            &quot;Tahoma&quot;,&quot;sans-serif&quot;;">
            ( 11 );</span><o:p></o:p></p>
        <p class="MsoNormal" style="margin-left: 0.25in;"><span
            style="font-family:
            &quot;Tahoma&quot;,&quot;sans-serif&quot;;">insertLogical(fact0
            );</span> <o:p></o:p></p>
        <p class="MsoNormal" style="margin-left: 0.25in;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          <o:p></o:p></p>
        <p class="MsoNormal" style="margin-left: 0.25in;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          But what I really want is something similar to my DRL from
          above.&nbsp; Am I
          missing something?&nbsp; 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: 0.25in;">&nbsp;<o:p></o:p></p>
        <p class="MsoNormal" style="margin-left: 0.25in;">Thank you!<o:p></o:p></p>
        <p class="MsoNormal" style="margin-left: 0.25in;">&nbsp;<o:p></o:p></p>
        <p class="MsoNormal" style="margin-left: 0.25in;">Dean Whisnant<o:p></o:p></p>
        <p class="MsoNormal" style="margin-left: 0.25in;">Senior
          Software Developer<o:p></o:p></p>
        <p class="MsoNormal" style="margin-left: 0.25in;">basys, inc.<o:p></o:p></p>
        <pre><o:p>&nbsp;</o:p></pre>
        <pre><o:p>&nbsp;</o:p></pre>
        <pre>_______________________________________________<o:p></o:p></pre>
        <pre>rules-users mailing list<o:p></o:p></pre>
        <pre><a moz-do-not-send="true" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><o:p></o:p></pre>
        <pre><a moz-do-not-send="true" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><o:p></o:p></pre>
      </div>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
    </blockquote>
  </body>
</html>