It should work just like
rule "checkHM"
when
$account : Account( hm[ "A" ] == "B" )
then
System.out.println( "HashMap has value B" );
end
P.S. The reason why get()
with HashMap might not work is probably due to the fact that Drools expects the facts to follow JavaBeans standard, and thus the method would need to be getGet()
for it to work directly.