<br> Hi Michal,<br><br> Looks like a bug. I just reproduced it. :(<br><br> Will fix that asap... but what a strange scenario... :(<br><br><a href="https://jira.jboss.org/jira/browse/JBRULES-2140">https://jira.jboss.org/jira/browse/JBRULES-2140</a><br>
<br> []s<br> Edson<br><br><div class="gmail_quote">2009/6/24 Michal Bali <span dir="ltr"><<a href="mailto:michalbali@gmail.com">michalbali@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<div><br></div><div>I've encountered a bizarre bug when a function is used together with a declared type and a rule with mvel dialect.</div><div><br></div><div>To reproduce create a default 'New Drools Project' in Eclipse and replace Sample.drl with the following:</div>
<div><div>--------------------------------------------------------------------------</div>
<div><div>package com.sample</div><div> </div><div>function void aaa() { // <----- comment this and it will work</div><div>}</div><div><br></div><div>declare SomeBean<span style="white-space: pre;">        </span></div>
<div><span style="white-space: pre;">        </span>prop : int</div><div>end</div><div> </div><div>rule "setup"</div><div>dialect "mvel" // <----- comment this and it will work</div>
<div><span style="white-space: pre;">        </span>when</div><div><span style="white-space: pre;">                </span>eval(true)</div><div><span style="white-space: pre;">        </span>then</div>
<div><span style="white-space: pre;">                </span>SomeBean someBean = new SomeBean();</div><div><span style="white-space: pre;">                </span>insert(someBean);</div><div><span style="white-space: pre;">                </span>System.out.println( "setup inserted:" + someBean);</div>
<div>end</div><div><br></div><div>rule "should never fire"</div><div>salience -20</div><div><span style="white-space: pre;">        </span>when</div><div><span style="white-space: pre;">                </span>not SomeBean()</div>
<div><span style="white-space: pre;">        </span>then</div><div><span style="white-space: pre;">                </span>System.out.println( "rule that should never fire fired !!!" );</div>
<div>end</div></div></div>
<div>------------------------------------------------------------------------</div><div><br></div><div>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.</div>
<div><br></div><div>Note that it breaks on JDK 1.5.0_12 however it works fine on JDK 1.6.0_14.</div><div>Tested on WinXP.</div><div><br></div><div>Is it just my machine or does anybody else see this issue?</div><div><br>
</div>
<div>Best regards,</div><div>Michal</div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> JBoss by Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>