[rules-users] Matching on instanceof without eval?

Barry Kaplan groups1 at memelet.com
Fri May 23 09:47:30 EDT 2008


I would like to match on the class of a field. I know I can use "eval(option
instanceof OptionInstrument)", but my understanding is that the use of eval
precludes indexing. What I want is something like the below, which does not
work. Is some other mechanism other than putting type codes that are
redundant with the class for this use case?

thanks!

----
rule "Long Call/Put, Short Uncovered Call/Put"
	when 
		position : Position(option : instrument, option.class ==
OptionInstrument.class)
	then
		...
end
----

-- 
View this message in context: http://www.nabble.com/Matching-on-instanceof-without-eval--tp17425953p17425953.html
Sent from the drools - user mailing list archive at Nabble.com.




More information about the rules-users mailing list