<br>&nbsp;&nbsp; Interesting question. This is not supported right now, but I see no reason (besides being a really technical, not business related constraint) why we shouldn&#39;t support it.<br>&nbsp;&nbsp; Just for the sake of exploring the issue, I played a bit with it and realized this is probably a limitation in our QualifiedIdentifierRestriction. There are work arounds, but I don&#39;t see any advantage in them compared to the eval. For instance, something like this will work:<br>
<br>position : Position(option : instrument, $oc : option.class )<br>Class( name == &quot;some.package.OptionInstrument&quot; ) from $oc<br><br>&nbsp;&nbsp;&nbsp; Or, in case you actually assert an OptionInstrument class into the working memory:<br>
<br>$oc : Class( name == &quot;some.package.OptionInstrument&quot; )<br>position : Position(option : instrument, option.class == $oc )<br>
<br>&nbsp;&nbsp;&nbsp; So, for now, probably best to use the eval (as bellow), and if you may, open a feature request for use to properly support it in the future.<br><br>position : Position(option : instrument, eval( option instanceof OptionInstrument ) )<br>
<br>&nbsp;&nbsp;&nbsp; []s<br>&nbsp;&nbsp;&nbsp; Edson<br>

<br><br><br><div class="gmail_quote">2008/5/23 Barry Kaplan &lt;<a href="mailto:groups1@memelet.com">groups1@memelet.com</a>&gt;:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
I would like to match on the class of a field. I know I can use &quot;eval(option<br>
instanceof OptionInstrument)&quot;, but my understanding is that the use of eval<br>
precludes indexing. What I want is something like the below, which does not<br>
work. Is some other mechanism other than putting type codes that are<br>
redundant with the class for this use case?<br>
<br>
thanks!<br>
<br>
----<br>
rule &quot;Long Call/Put, Short Uncovered Call/Put&quot;<br>
 &nbsp; &nbsp; &nbsp; &nbsp;when<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;position : Position(option : instrument, option.class ==<br>
OptionInstrument.class)<br>
 &nbsp; &nbsp; &nbsp; &nbsp;then<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;...<br>
end<br>
----<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://www.nabble.com/Matching-on-instanceof-without-eval--tp17425953p17425953.html" target="_blank">http://www.nabble.com/Matching-on-instanceof-without-eval--tp17425953p17425953.html</a><br>

Sent from the drools - user mailing list archive at Nabble.com.<br>
<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>
</font></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> Office: +55 11 3529-6000<br> Mobile: +55 11 9287-5646<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>