tags:

views:

94

answers:

1

Just looking for a way to pass parameters into a getter in Drools...

I have noticed in Eclipse Ganymede that intellisense is helpful in determining the getters that can be used to select an entity in a Drools WHERE clause. Just type a letter and hit ctrl+Space to see the list. I have another project in Drools.NET that relies on C# Properties instead of get methods. C#.NET lets you define a default property as public String this[String key] so you can refer to a list without any property as myInstance["myKeyString"] and I have used this in Drools.NET. I was hoping that the this[''] option that appears in Java Drools between the curlies of a WHERE clause entity selector like myInstance : myClass { ... } refers to something similar.

Is this true, and if so, how do I use it?

A: 

No isn't an equivalent of that style of properties in drools java - all facts must be strongly defined up front before compiling.

There may be a way to use a field which is a Map though, and access things via keys.

Michael Neale