[rules-users] Strange rule compilation issue.

Edson Tirelli ed.tirelli at gmail.com
Wed Feb 3 14:03:25 EST 2010


     Hi Brice,

     You are doing it right:

Scenario( id == 6147 )

     We've been through quite some changes in trunk, and because of that
there were some regressions that are being fixed as we speak. I suggest that
you either use the stable 5.0.1 for now or if you can wait till M2, it
should fix this kind of issue.

     Edson

2010/2/3 Brice Figureau
<brice+drools at daysofwonder.com<brice%2Bdrools at daysofwonder.com>
>

> Hi,
>
> I have the following MVEL expression in a rule (with drools 5.1.0M1):
>
> Scenario( id == 6147 )
>
> Scenario is an interface which has the following accessor (and tons of
> other methods):
>
> public interface Scenario
> {
> ...
>        public int getId();
> ...
> }
>
> But either in Eclipse or when compiling the rules I get the following
> error:
> Unable to create Field Extractor for 'id' of '[ClassObjectType
> class=com.daysofwonder.mm.Scenario]'
>
> I tried tons of variants including:
> Scenario( getId == 6147 )
> that still doesn't work.
>
> The only variant I could make work is:
>
> $s : Scenario( )
> Scenario ( eval($s.getId() == 6147 ) )
>
> which is plain ugly.
>
> using something else than a Scenario or defining a new interface with
> only getId() in it makes it work.
>
> Any idea about what I got wrong?
> How can I debug the situation?
>
> Thanks,
> --
> Brice Figureau
> My Blog: http://www.masterzen.fr/
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 Edson Tirelli
 JBoss Drools Core Development
 JBoss by Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100203/3165246c/attachment.html 


More information about the rules-users mailing list