<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16587" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=6><STRONG>ERGO.....</STRONG></FONT></DIV>
<DIV><FONT face=Arial size=6><STRONG></STRONG></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><STRONG><FONT size=6>.....</FONT></STRONG><FONT 
size=4>
<P><STRONG>Defining rules saturday night DOES make me mad!</STRONG></P>
<P><STRONG></STRONG>&nbsp;</P>
<P><STRONG>:D</STRONG></P>
<P><STRONG></STRONG>&nbsp;</P>
<P><STRONG>Next saturdays I will make sure to party, instead of defining 
Drules... ;-)</STRONG></P>
<P><STRONG></STRONG>&nbsp;</P>
<P><STRONG>Massi</STRONG></P></FONT></FONT></DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV>&lt;<A href="mailto:mmquelo@gmail.com">mmquelo@gmail.com</A>&gt; ha 
  scritto nel messaggio <A 
  href="news:fp7oom$r59$1@ger.gmane.org">news:fp7oom$r59$1@ger.gmane.org</A>...</DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>Look at this....</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>I have got a "ContractWrapper" fact inserted into 
  WM.</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>It wraps a "Contract" object and some "enums" 
  fields.</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>One of these fields is "upronto":</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
    <DIV><FONT face=Arial size=2><B><FONT color=#7f0055 size=2>
    <P align=left>public</B></FONT><FONT size=2> </FONT><B><FONT color=#7f0055 
    size=2>class</B></FONT><FONT size=2> ContractWrapper </FONT><B><FONT 
    color=#7f0055 size=2>extends</B></FONT><FONT size=2> 
    BaseOmPersistentWithAssignedId{</P>
    <P align=left>Contract </FONT><FONT color=#0000c0 
    size=2>mycontract</FONT><FONT size=2>=</FONT><B><FONT color=#7f0055 
    size=2>null</B></FONT><FONT size=2>;</P>
    <P align=left></P>
    <P align=left>...</P>
    <P align=left></FONT><FONT size=2>Pronto </FONT><FONT color=#0000c0 
    size=2>upronto</FONT><FONT size=2> = </FONT><B><FONT color=#7f0055 
    size=2>null</B></FONT><FONT size=2>;</P>
    <P align=left><STRONG><FONT color=#7f0055>...</FONT></STRONG></FONT><FONT 
    size=2> 
    <P align=left></P>
    <P align=left><EM>&lt;getters and setters....&gt;</EM></FONT><FONT 
    size=2></P>
    <P></P></FONT><FONT size=2>
    <P align=left></P>
    <P align=left></P>
    <P align=left></P>
    <P align=left></P>
    <P>...</P>
    <P>}</P></FONT></FONT></DIV></BLOCKQUOTE>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>"upronto" is an insance of a "Pronto" java 
  enum:</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
    <DIV><B><FONT color=#7f0055 size=2>
    <P align=left>public</B></FONT><FONT size=2> </FONT><B><FONT color=#7f0055 
    size=2>enum</B></FONT><FONT size=2> Pronto {</P></FONT><I><FONT 
    color=#0000c0 size=2>
    <P align=left>N</I></FONT><FONT size=2>,</P></FONT><I><FONT color=#0000c0 
    size=2>
    <P align=left>UNKNOWN</I></FONT><FONT size=2>,</P></FONT><I><FONT 
    color=#0000c0 size=2>
    <P align=left>Y</I></FONT><FONT size=2>;</P>
    <P align=left>}</P></FONT></DIV></BLOCKQUOTE>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>"Pronto" can be : (Y, N, UNKNOWN)</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>Here is the rule which reasons over this 
  enum:</FONT></DIV>
  <DIV><FONT face=Arial size=2>(ofcourse I have got a Request into WM as 
  well)</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2><EM>rule "ScorePronto"<BR>dialect 
  "mvel"<BR>ruleflow-group "Scoring"<BR>&nbsp;when<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
  $r:Request( $mc:mainContract != null )<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
  $cw_p:ContractWrapper($c_w_p:mycontract == $mc, eval(upronto != 
  Pronto.Y))</EM></FONT></DIV>
  <DIV><FONT face=Arial size=2><EM>&nbsp;then&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
  System.out.println("Test Result: "+($cw_p.upronto == 
  Pronto.Y))&nbsp;&nbsp;<BR>end</EM></FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>Any guesses for the output???</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>Well....</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT><FONT face=Arial 
size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2><STRONG>Test Result: true</STRONG></FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>HOW COMES???????????????????</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>I mean ... the test "eval(upronto != Pronto.Y)" 
  returned "true".... It means that the rule</FONT></DIV>
  <DIV><FONT face=Arial size=2>engine sees upronto &lt;&gt; Pronto.Y!, doesn't 
  it??!!!!</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2><STRONG>So... why do I get "upronto == Pronto.Y" 
  in the RHS????</STRONG></FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>What 
  the.........&amp;$%%&amp;()%%$/%£....sorry....but having these</FONT></DIV>
  <DIV><FONT face=Arial size=2>kind of problems during saturday night is not so 
  pleaseant!&nbsp; </FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>T-T</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>I really hope you can help me&nbsp;with a 
  &nbsp;workaround to this issue.</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>Bye</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>Massi</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <P>
  <HR>

  <P></P>_______________________________________________<BR>rules-users mailing 
  list<BR>rules-users@lists.jboss.org<BR>https://lists.jboss.org/mailman/listinfo/rules-users<BR></BLOCKQUOTE></BODY></HTML>