• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Storing equations in XML?

 
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Anthony,

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

- m
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How about trying out a real rule engine like one of these or Ernest's JESS?
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic