[rules-users] Drools 3.0.6 support for enum's on jdk 1.5 ?

Kris Nuttycombe kris.nuttycombe at gmail.com
Tue Aug 19 11:39:27 EDT 2008


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?

Thanks,

Kris

On Wed, Aug 13, 2008 at 2:42 PM, Maxim Veksler <maxim.veksler at gmail.com> wrote:
> 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
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>



More information about the rules-users mailing list