J
Jason Shohet
I want to build a rules engine in a rules.xml page. I was thinking it
would look like this:
- Rules
- rule1 if (0 < iTime <= .5) { iFee = 15; }
- rule2 if (.5 < iTime <= 1) { iFee = 20; }
- yada yada
Now lets say in my c# code I loop thru the Rules node of rules.xml, and I
want to evaluate each rule, given an iTime that the user inputed -- lets
say its .7. I want rule2 to evaluate and say, "Oh, iTime of .7 fits into
this equation, so iFee = 20" ! But I'm not sure how to get a string from
an xml node to evaluate as if it was c# code. Is it simply the evaluate
function or something like that? Does what I'm thinking of doing make sense
at all ?
TY Jason Shohet
would look like this:
- Rules
- rule1 if (0 < iTime <= .5) { iFee = 15; }
- rule2 if (.5 < iTime <= 1) { iFee = 20; }
- yada yada
Now lets say in my c# code I loop thru the Rules node of rules.xml, and I
want to evaluate each rule, given an iTime that the user inputed -- lets
say its .7. I want rule2 to evaluate and say, "Oh, iTime of .7 fits into
this equation, so iFee = 20" ! But I'm not sure how to get a string from
an xml node to evaluate as if it was c# code. Is it simply the evaluate
function or something like that? Does what I'm thinking of doing make sense
at all ?

TY Jason Shohet