<!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">
Kris Nuttycombe wrote:
<blockquote
 cite="mid:2771e600808190839g109d7169x25b49beb8a940d45@mail.gmail.com"
 type="cite">
  <pre wrap="">It's been a few days since this question was asked, and I am also
interested in the answer. I'm currently using an eval to get around
the problem, but is there any way to check enum equivalence directly
in drools?
  </pre>
</blockquote>
I beleive it'll work with primitive enums (int), but not enum classes.
If you tried it and it doesn't work, probably safe to assume it doesn't
support it :)<br>
<br>
Mark<br>
<blockquote
 cite="mid:2771e600808190839g109d7169x25b49beb8a940d45@mail.gmail.com"
 type="cite">
  <pre wrap="">
Thanks,

Kris

On Wed, Aug 13, 2008 at 2:42 PM, Maxim Veksler <a class="moz-txt-link-rfc2396E" href="mailto:maxim.veksler@gmail.com">&lt;maxim.veksler@gmail.com&gt;</a> wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Hello list,

I have a rule that generally speaking looks like this :

rule "ABC"
when
    $f : FilteringStateConnector($campaignId : campaignId)


    $campaign : Campaign(code == $campaignId
        ,$limitTypeEnum : limitTypeEnum, $limitByEventType :
limitByEventType)


     // Check Budget limit pass conditions:
    (
        eval(BooleanLogging.trace(log,    "DEBUG: " + ($limitTypeEnum ==
ENUM1.BudgetLimitFlag))) and
        eval(BooleanLogging.trace(log,    "DEBUG: Always here, right now"))
and
        eval(BooleanLogging.trace(log,    "DEBUG: " + ($limitByEventType ==
ENUM2._2_EXPOSED))) and

        Campaign(code == $campaignId, limitTypeEnum ==
ENUM1.BudgetLimitFlag, limitByEventType ==  ENUM2._2_EXPOSED) and

        eval(BooleanLogging.trace(log,    "DEBUG: Right here, right now"))

    ) or (
        ...
    )

then
...
end



The line """        eval(BooleanLogging.trace(log,    "DEBUG: " +
($limitTypeEnum == ENUM1.BudgetLimitFlag))) """ evaluates to "true" in the
logs.
The line """        eval(BooleanLogging.trace(log,    "DEBUG: " +
($limitByEventType == ENUM2._2_EXPOSED))) """ as well. These are java (eval)
checks for truth. If I try to use Drools to gain the rete optimization by
writing :
"""        Campaign(code == $campaignId, limitTypeEnum ==
ENUM1.BudgetLimitFlag, limitByEventType ==  ENUM2._2_EXPOSED)  """, It never
reachers past that line. why is that? Can't Drools 3 check for truthness of
Enum conditionals ?


I would love to supply more information if required.



Help is highly appreciated,
Maxim.

--
Cheers,
Maxim Veksler

"Free as in Freedom" - Do u GNU ?

_______________________________________________
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>
  <pre wrap=""><!---->_______________________________________________
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>