473,508 Members | 2,392 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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


Nov 15 '05 #1
2 1688
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.

" Jason Shohet" <as****@hotmail.com> wrote in message
news:uz**************@TK2MSFTNGP09.phx.gbl...
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

Nov 15 '05 #2
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
Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
3006
by: Robert Brown | last post by:
suppose I have the following table: CREATE TABLE (int level, color varchar, length int, width int, height int) It has the following rows 1, "RED", 8, 10, 12 2, NULL, NULL, NULL, 20...
6
2561
by: Chris Travers | last post by:
Hi all; I am using PostgreSQL 7.4 on RedHat 9, though I don't think that is important to this problem. I am attempting to write a rule that will check to see whether certain conditions are...
3
23074
by: Ian Boyd | last post by:
i know nothing about DB2, but i'm sure this must be possible. i'm trying to get a client to create a view (which it turns out is called a "Logical" in DB2). The query needs a LEFT OUTER JOIN, but...
0
1158
by: John Puopolo | last post by:
All, I am writing an application that requires a very light weight rules engine. The core requirement is for me to express a simple rule such as: If the value of X > 100, send an e-mail else...
11
2588
by: hazz | last post by:
before I start filling up the first page of perhaps many pages of code with if/then or switch:case buckets, I wanted to step back and see if there is a better way... I will have a table with up to...
11
2522
by: Brent Ritchie | last post by:
Hello all, I have been using C# in my programming class and I have grown quite fond of C# properties. Having a method act like a variable that I can control access to is really something. As...
5
4865
by: Michal Taborsky | last post by:
Hello. We are currently facing a design issue, which I am a bit stuck with. We are talking about row-level access regulation. I'll make it clear with an example. Let there be a table of...
13
2516
by: Alison Givens | last post by:
....... that nobody knows the answer. I can't imagine that I am the only one that uses parameters in CR. So, my question again: I have the following problem. (VB.NET 2003 with CR) I have a...
2
1026
by: Wolf Saenger | last post by:
Hi, Is Sombody using a Business Rule Manager System? Is there a affordable system to recomended? You opinion please tia / regards Wolf
0
7224
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7120
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7323
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
5626
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5050
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1553
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
415
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.