[rules-users] function & mvel & declare - possible bug

Michal Bali michalbali at gmail.com
Fri Jun 26 04:59:45 EDT 2009


Hi Edson,
Thanks for fixing this. I'll try it as soon as the SNAPSHOT build becomes
available in hudson. Also thanks for the detailed info in the JIRA.
Best regards,
Michal


2009/6/25 Edson Tirelli <tirelli at post.com>

>
>    Chris,
>
>    I found and fixed the problem you mention and will commit it together
> with the fix for this issue.
>
>    []s
>    Edson
>
>
> 2009/6/24 Chris Richmond <crichmond at referentia.com>
>
>>  I have been completely unable to declare a function within my .drl file
>> using mvel dialect as well….so I’m very interested in this…
>>
>>
>>
>> Thanks,
>>
>>
>> Chris
>>
>>
>>  ------------------------------
>>
>> *From:* rules-users-bounces at lists.jboss.org [mailto:
>> rules-users-bounces at lists.jboss.org] *On Behalf Of *Michal Bali
>> *Sent:* Wednesday, June 24, 2009 6:01 AM
>> *To:* Rules Users List
>> *Subject:* [rules-users] function & mvel & declare - possible bug
>>
>>
>>
>> Hi,
>>
>>
>>
>> I've encountered a bizarre bug when a function is used together with a
>> declared type and a rule with mvel dialect.
>>
>>
>>
>> To reproduce create a default 'New Drools Project' in Eclipse and replace
>> Sample.drl with the following:
>>
>> --------------------------------------------------------------------------
>>
>> package com.sample
>>
>>
>>
>> function void aaa() { // <----- comment this and it will work
>>
>> }
>>
>>
>>
>> declare SomeBean
>>
>>             prop : int
>>
>> end
>>
>>
>>
>> rule "setup"
>>
>> dialect "mvel"   // <----- comment this and it will work
>>
>>             when
>>
>>                         eval(true)
>>
>>             then
>>
>>                         SomeBean someBean = new SomeBean();
>>
>>                         insert(someBean);
>>
>>                         System.out.println( "setup inserted:" +
>> someBean);
>>
>> end
>>
>>
>>
>> rule "should never fire"
>>
>> salience -20
>>
>>             when
>>
>>                         not SomeBean()
>>
>>             then
>>
>>                         System.out.println( "rule that should never fire
>> fired !!!" );
>>
>> end
>>
>> ------------------------------------------------------------------------
>>
>>
>>
>> Run the DroolsTest.java and see that the last rule that should never
>> fire is actually fired. If you comment out the 'aaa' function or change the
>> dialect to 'java' all works fine.
>>
>>
>>
>> Note that it breaks on JDK 1.5.0_12 however it works fine on JDK 1.6.0_14.
>>
>> Tested on WinXP.
>>
>>
>>
>> Is it just my machine or does anybody else see this issue?
>>
>>
>>
>> Best regards,
>>
>> Michal
>>
>> _______________________________________________
>> 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
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20090626/5ed04efa/attachment.html 


More information about the rules-users mailing list