Home All Groups Group Topic Archive Search About

score object property values against a decision rule created from from database table record values

Author
2 Jul 2005 12:58 AM
hazz
if i have a table record called Rule 1 with

1. table name
2. table column name
3. operator   (>,< =)
4. value  (0 to n)
5. score

how could I create code to create a rule automatically so that i could
create an object to compare to these rules in the database.
If I have an object with certain characteristics that I want to
evaluate(score), like
o.pizza

if o.pizza.olives > 50 then score = 10
else if pizza.olives < 50 then score = 5

so I will be creating an object against which I will be running it through a
filter of many, many if then else statements.
I have tried a couple of xml base rule engines and they are too complicated.

Can anyone help with any part of this process to at least simplify parts of
this task?

Thank you very much.
-hazz

Author
3 Jul 2005 7:13 AM
Cor Ligthert
Hazz,

I don't like this kind of programming (although I see your purpose).

Have a look on Internet for Eval. This is a page that is certainly about it.
http://www.eggheadcafe.com/articles/20030908.asp

However I have it already for a long time in my saved links.

I hope this helps,

Cor
Author
3 Jul 2005 5:21 PM
hazz
Thank you Cor. I am looking at this right now. -hazz

Show quoteHide quote
"Cor Ligthert" <notmyfirstn***@planet.nl> wrote in message
news:%23t7Qi75fFHA.1996@TK2MSFTNGP10.phx.gbl...
> Hazz,
>
> I don't like this kind of programming (although I see your purpose).
>
> Have a look on Internet for Eval. This is a page that is certainly about
> it.
> http://www.eggheadcafe.com/articles/20030908.asp
>
> However I have it already for a long time in my saved links.
>
> I hope this helps,
>
> Cor
>
Author
3 Jul 2005 5:52 PM
hazz
it is interesting when someone gives me an excellent answer to a question I
asked....and then I don't understand the answer....at least initially.   ;-)

Show quoteHide quote
"Cor Ligthert" <notmyfirstn***@planet.nl> wrote in message
news:%23t7Qi75fFHA.1996@TK2MSFTNGP10.phx.gbl...
> Hazz,
>
> I don't like this kind of programming (although I see your purpose).
>
> Have a look on Internet for Eval. This is a page that is certainly about
> it.
> http://www.eggheadcafe.com/articles/20030908.asp
>
> However I have it already for a long time in my saved links.
>
> I hope this helps,
>
> Cor
>