Hi,<br><br>I am using Drools 4.0.7, and I had a DRL rule similar to the following:<br><br>rule &quot;...&quot;<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: &quot;org.mvel.CompileException: unable to resolve property: ...&quot;<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. &quot;Baz cannot be cast into Bar&quot;).<br><br>If, instead, I changed the rule to:<br>
    x : Bar( other.property == x ) <br><br>It would start working correctly, and &#39;x&#39; 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 &quot;from&quot; 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&#39;m still waiting for the blocking JBRULES-2218 to be resolved.<br><br>Cheers<br>Jevon<br>