Probably kindof late on the subject, however :
I have the same problem, I use Database result into drools, which by
nature are more key/value object than hard beans.
I, however, use java's proxy mechanism to dynamicaly turn my key/value
pair into solid state beans (by implementing an Interface that is hard
coded).
It allows for a better exploitation of DRL since it's heavily based on
object's class and property. It's a form of relational/object maping in
a sense.
The only drawback is you are forced to hardcode an interface, however I
finally think it is allways good to have an object model of your real
world datas, provided the mapping is done dynamicly and effortlessly.
Beto Siless a écrit :
Steven, Edson:
First of all, thank you very much for answering my question!
I will try the two approaches. I read and tested "eval" and "return
value" and seems to work fine! but I'm afraid that I will loose a lot
of expression, what do you think about? Is worth of it to use drools
this way?
The ASM approach looks good cause it's not possible for me to map my
data to real beans.
I'm eager to integrate drools to my system. Drools is exactly the
solution that I need. So, the new question is:
Do you think that in this scenario (dynamic data) would be ok to use
drools?
Thank you very very much
Beto
Edson Tirelli wrote:
Beto,
Unfortunatelly, not with current codebase. We are looking into
allowing that in the future, but for now, best thing would be if you
can map them to real beans.
There is another option a bit more complex that is dynamic bytecode
generation for your beans. It is pretty easy to do, though, if you
know ASM or if you get a sample code for bean class generation.
[]s
Edson
Beto Siless wrote:
Hi all!
I'm new to drools/JBoss rules, the problem is the following:
The system that requires rules, manages dynamic data extracted from
a DB. Each row or data item is stored in a kind of KEY/VALUE map. So
I haven't got hard beans with properties. The question is: Is there
a way to write rules about dynamic properties?
Example:
Map cheese = new HashMap();
m.put("name", "Cheddar");
m.put("price", 10);
Rule "Is cheddar"
when
m:Map(get("name")=="cheddar")
then ...
Thanks in advance!
Beto
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email
--
___________________
*Gabriel Quennesson *| CTC/I | *SEAM*
Int :* *7 906 6910 | Ext: 04 73 64 69 10
[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email