<!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">
not ( SomeClass(....) ) is an existential conditional eleemnt operator,
it goes at the head of pattern, and checks if the pattern plus its
field constraints exist in the session; it will cause a rule to fire
once whether there is 1 or 100 matching patterns.<br>
<br>
SomeClass( somefield not in ('x, 'y', 'z) ) is a field constraint on a
pattern, it checks if the value of a field is in a list of values, it
will cause the rule to fire for each and every possible rule match.<br>
<br>
Mark<br>
JOSHI, GAURAV wrote:
<blockquote
 cite="mid:7C7C72D1EFE973489F3AF325C7C1BABC0227969A@BOMEX002.corp.capgemini.com"
 type="cite">
  <meta http-equiv="Content-Type" content="text/html; ">
  <meta name="Generator" content="Microsoft Word 11 (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]--><o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="City">
  <o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place"><!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
  <style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
 /* List Definitions */
 @list l0
        {mso-list-id:1738745905;
        mso-list-type:hybrid;
        mso-list-template-ids:765200000 -2036177978 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-text:"%1\)";
        mso-level-tab-stop:.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:12.0pt;
        font-family:"Times New Roman";
        color:windowtext;
        mso-ansi-font-weight:normal;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
-->
  </style></o:SmartTagType></o:SmartTagType>
  <div class="Section1">
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">Thank&#8217;s for
your sugession of using &#8220;not
in&#8221; instead of &#8220;not&#8221; but my problem is that &#8220;not&#8221;
can also come without &#8220;in&#8221;.<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">Actually I
am making a generator of rule
file from expression like<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">&nbsp;(</span></font><font
 face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">(NOT (ENDS WITH
(G10.2, ",")))<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">&nbsp;<font color="black"><span
 style="color: black;">((NOT
(G13.1 IN ("1","2","3"))) OR (G250.8 = Y))</span></font><font
 color="navy"><span style="color: navy;">)<o:p></o:p></span></font></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">Where G13.2,
G250.8, G10.2 are variables coming
from a map inserted in working memory.<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">I am
accessing these variables from map.<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">My rules are
as follows<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">This rule is
working fine.<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">rule
"Editable_G10.3"<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">when<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal"><b><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy; font-weight: bold;">&nbsp;((Map(
this["G10.3"] !=8))||(Map( this["G10.2"] ==19)))<o:p></o:p></span></font></b></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">then<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">System.out.println("comming
here-----------------------------------------------------&gt;");<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">End<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal"><b><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy; font-weight: bold;">This
is
not working<o:p></o:p></span></font></b></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">rule
"Mandatory_G10.3"<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">when<o:p></o:p></span></font></p>
  <p class="MsoNormal"><b><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy; font-weight: bold;">&nbsp;(not((Map(
this["G10.3"] !=8))||(Map( this["G10.2"] ==19)))) <o:p></o:p></span></font></b></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">Then<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">System.out.println("comming
here-----------------------------------------------------&gt;");<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">End<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal"><font face="Times New Roman" size="3"><span
 style="font-size: 12pt;">In also tried following approaches:<o:p></o:p></span></font></p>
  <p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"><!--[if !supportLists]--><font
 face="Times New Roman" size="3"><span style="font-size: 12pt;"><span
 style="">1)<font face="Times New Roman" size="1"><span
 style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span></font></span></span></font><!--[endif]--><b><font color="navy"
 face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy; font-weight: bold;">eval(not((Map(
this["G10.3"]
!=8))||(Map( this["G10.2"] ==19)))) <o:p></o:p></span></font></b></p>
  <p class="MsoNormal"><b><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy; font-weight: bold;"><o:p>&nbsp;</o:p></span></font></b></p>
  <p class="MsoNormal" style="text-indent: 0.25in;"><b><font
 color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy; font-weight: bold;">2)
eval(!((Map( this["G10.3"] !=8))||(Map(
this["G10.2"] ==19)))) <o:p></o:p></span></font></b></p>
  <p class="MsoNormal" style="margin-left: 0.25in;"><b><font
 color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy; font-weight: bold;"><o:p>&nbsp;</o:p></span></font></b></p>
  <p class="MsoNormal"><font face="Times New Roman" size="3"><span
 style="font-size: 12pt;">But in both cases it is giving same error:<o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="red" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;">org.drools.rule.InvalidRulePackage:
Rule Compilation error : [Rule
name=ValidationRuleExp_G10.3, agendaGroup=MAIN, salience=0,
no-loop=false]</span></font><font face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="red" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
com/telekurs/nva/mde/fe/ak/validation/Rule_ValidationRuleExp_G10_3_0.java
(11:495) : Cannot use this in a static context </span></font><font
 face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="red" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
com/telekurs/nva/mde/fe/ak/validation/Rule_ValidationRuleExp_G10_3_0.java
(11:500) : Type mismatch: cannot convert from String to int<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">I am trying
to find out some general
concept so that I can change just achieve the functionality of not.<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">Thanks<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">Gaurav <o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;"><o:p>&nbsp;</o:p></span></font></p>
  <div>
  <div class="MsoNormal" style="text-align: center;" align="center"><font
 face="Times New Roman" size="3"><span style="font-size: 12pt;">
  <hr tabindex="-1" align="center" size="2" width="100%"></span></font></div>
  <p class="MsoNormal"><b><font face="Tahoma" size="2"><span
 style="font-size: 10pt; font-family: Tahoma; font-weight: bold;">From:</span></font></b><font
 face="Tahoma" size="2"><span
 style="font-size: 10pt; font-family: Tahoma;">
<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><span
 style="font-weight: bold;">On
Behalf Of </span></b>Edson Tirelli<br>
  <b><span style="font-weight: bold;">Sent:</span></b> Wednesday,
September 12,
2007 10:20 PM<br>
  <b><span style="font-weight: bold;">To:</span></b> Rules Users List<br>
  <b><span style="font-weight: bold;">Subject:</span></b> Re:
[rules-users] How to
use not operator in drool.</span></font><o:p></o:p></p>
  </div>
  <p class="MsoNormal"><font face="Times New Roman" size="3"><span
 style="font-size: 12pt;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal" style="margin-bottom: 12pt;"><font
 face="Times New Roman" size="3"><span style="font-size: 12pt;"><br>
&nbsp;&nbsp; Remove your "eval" and use "or" instead of
"||" for the OR CE.<br>
  <br>
&nbsp;&nbsp; Although, I feel that this is not what you want... what you want
is simply:<br>
  <br>
when<br>
&nbsp;&nbsp;&nbsp; Map( this['city'] not in ( "mumbai", "<st1:City w:st="on"><st1:place
 w:st="on">delhi</st1:place></st1:City>" ) ) <br>
then<br>
&nbsp;&nbsp;&nbsp; //...<br>
end<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp; []s<br>
&nbsp;&nbsp;&nbsp; Edson<o:p></o:p></span></font></p>
  <div>
  <p class="MsoNormal"><span class="gmailquote"><font
 face="Times New Roman" size="3"><span style="font-size: 12pt;">2007/9/12,
Gaurav2007 &lt;<a moz-do-not-send="true"
 href="mailto:gaurav.a.joshi@capgemini.com">gaurav.a.joshi@capgemini.com</a>&gt;:</span></font></span><o:p></o:p></p>
  <p class="MsoNormal"><font face="Times New Roman" size="3"><span
 style="font-size: 12pt;"><br>
Hi ALL,<br>
  <br>
I am using drool4.0.1 in my application i am able to use IN,OR,AND
operator<br>
but i am facing problem in using not operator.<br>
  <br>
my requirement of not operator is just like a not gate.<br>
  <br>
the way i am using it is : <br>
  <br>
eval(not((Map( this["city"] !="mumbai"))||(Map(
this["city"] =="<st1:City w:st="on"><st1:place w:st="on">delhi</st1:place></st1:City>"))))<br>
  <br>
  <br>
so can you please help me out to solve this problem:<br>
should i use not operator or some thing else in drool. <br>
  <br>
Thanks,<br>
  <br>
  <br>
--<br>
View this message in context: <a moz-do-not-send="true"
 href="http://www.nabble.com/How-to-use-not-operator-in-drool.-tf4430240..html#a12638430">http://www.nabble.com/How-to-use-not-operator-in-drool.-tf4430240.html#a12638430
  </a><br>
Sent from the drools - user mailing list archive at <a
 moz-do-not-send="true" href="http://Nabble.com">Nabble.com</a>.<br>
  <br>
_______________________________________________<br>
rules-users mailing list<br>
  <a moz-do-not-send="true" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
  <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></span></font></p>
  </div>
  <p class="MsoNormal"><font face="Times New Roman" size="3"><span
 style="font-size: 12pt;"><br>
  <br clear="all">
  <br>
-- <br>
&nbsp;&nbsp;Edson Tirelli <br>
&nbsp;&nbsp;Software Engineer - JBoss Rules Core Developer<br>
&nbsp;&nbsp;Office: +55 11 3529-6000<br>
&nbsp;&nbsp;<st1:City w:st="on"><st1:place w:st="on">Mobile</st1:place></st1:City>:
+55 11 9287-5646<br>
&nbsp;&nbsp;JBoss, a division of Red Hat @ <a moz-do-not-send="true"
 href="http://www.jboss.com">www.jboss.com</a>
  <o:p></o:p></span></font></p>
  </div>
  <table>
    <tbody>
      <tr>
        <td bgcolor="#ffffff"><font color="#000000">This message
contains information that may be privileged or confidential and is the
property of the Capgemini Group. It is intended only for the person to
whom it is addressed. If you are not the intended recipient, you are
not authorized to read, print, retain, copy, disseminate, distribute,
or use this message or any part thereof. If you receive this message in
error, please notify the sender immediately and delete all copies of
this message.<br>
        <br>
        </font></td>
      </tr>
    </tbody>
  </table>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
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>
<br>
</body>
</html>