I need to compare two fields in a case insensitive way. I have a rule something like this:
foo : ObjectTypeA()
bar : ObjectTypeB( name == foo.name )
And that works for strings that are the same case. What I need is something like this, but it doesn't seem to work:
foo : ObjectTypeA()
bar : ObjectTypeB( name.equalsIgnoreCase( foo.name ) )
Any suggestions on how to get that to work? Googling hits on suggestions to use "matches", but the matches operator only seems to work against a hard coded pattern.
Use eval. equalsIgnoreCase method also had a typo in your example code.
bar : ObjectTypeB( eval( name.equalsIgnoreCase( foo.name ) ) )
If you want to use something like:
ObjectType( name equalsIgnoreCase foo.name )
You can take a look at Drools custom operators. Example: http://members.inode.at/w.laun/drools/CustomOperatorHowTo.html