Hi,<br><br>I am using Drools 4.0.7, and I had a DRL rule similar to the following:<br><br>rule "..."<br> when<br> other : Foo( )<br> x : Bar( ) from other.property<br><br> then<br> ...<br>end<br><br>An unexpected bug occured. In some situations, other.property would _not_ be of type Bar, yet Drools would still think that it was. As a result I was getting some unusual exceptions being thrown: "org.mvel.CompileException: unable to resolve property: ..."<br>
<br>If I changed the rule to:<br> x : Bar( ) from other.property<br> eval ( x instanceof Bar )<br><br>It would instead throw a ClassCastException (i.e. "Baz cannot be cast into Bar").<br><br>If, instead, I changed the rule to:<br>
x : Bar( other.property == x ) <br><br>It would start working correctly, and 'x' would only be of type Bar.<br><br>Is this known behaviour? Is it expected? If so, I would appreciate it if the 4.0.7 documentation was updated to reflect that "from" actually ignores the return type of properties. It took me a couple of hours to detect and fix this bug.<br>
<br>I would try these rules in Drools 5.x, but I'm still waiting for the blocking JBRULES-2218 to be resolved.<br><br>Cheers<br>Jevon<br>