possible 2 create rules engine w/ XML instead of C#?

  • Thread starter Thread starter Jason Shohet
  • Start date Start date
J

Jason Shohet

I have 6 rules for a given 'time' value.

if (0 < iTime <= .5) {iFee = 17}
else if ( .5 < iTime <= 1) {iFee = 20}
else if...
else if...
yada yada

I don't want to code this in C# within my application, or a web service,
because then I have to recompile everytime a user decides to tweek the rules
above. I was thinking that I could create a javascript function and have
the .NET app call it, passing in the iTime, and getting back iFee.
But Javascript is a pain to work with. I'm wondering -- if there's a
derivation of XML -- that can do this. Pass in a value, get back something
else: a rules engine thats easy to modify.

TY for any advice
Jason Shohet
 
If the rules are as simple as the example then all you need to store in the
config file is the break levels and the associated fee. The logic engine
can remain in your compiled code as it doesn't actually change - only the
values it uses do.
 
Dan,

But if I just store the break level, .5, it doesn't tell me if the fee
associated with that is less than, less than or equal, or more than .5.
What if the user decides "I want from 0 to .5 hrs -- not including 5, to be
$17. And .5 to 1 hr to be 20." -- Before it was less than or equal to .5,
now its become less than .5, and if the time equals .5 itself, it goes to
the next tier. This could happen.
If I just store the break values in there I don't have good control, I
somehow need to store the evaluators (<, > etc).

VR,
Jason Shohet
 
Back
Top