Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!

# Storing equations in XML?

Anthony Smith
Ranch Hand
Posts: 285
Hey,

I am really looking for an open source solution vs. creating anything to do this is possible. This is sort of related to a rules engine of some sort.

Let me just give an example.

I sell candy and I have three factors that make up your price:
Delivery
Weight
Type

If I deliver candy it will cost you a buck \$1
If your candy weighs less than 1 pound I only charge you a buck \$1
If your candy weighs 1 pound or more but less then 5 pounds I charge you \$2
If your candy weighs 5 pounds or more but less than 10 pounds I charge you \$2.50
If your candy weighs 10 pounds or more, I charge you \$.75 a pound
If you want black candy it is \$2, red is \$3

You total cost for candy is the delivery charge the weight charge plus the type. If it equals over \$5 than I will just charge you \$5. SO \$5 is the max that I will charge you.

I dont want to put this stuff in java code. I want to be able to update it from tiem to time w/o changing the code... ideas?

Ranch Hand
Posts: 5040
Anthony,

I read this post, not ignoring, but can't think of anything off the
top of my head right now.....

- m

Lasse Koskela
author
Sheriff
Posts: 11962
5
How about trying out a real rule engine like one of these or Ernest's JESS?