Defining dynamic sets of business rules
Posted in 1997
Topics: General Discussion
Hi all, I have a database application where i want to validate a bunch of fields against some known "business rules". Of course the rules and the fields are must be dynamic and table driven. Here is an example of the application of these rules: Registration screen consists of 2 fields, state and sales_code I want to define a rule that says "if state =nj return 1" I also want to make sure that all "xxx" sales_codes return 5 "if sales_code=xxx return 5" What is the best way to do this. Say i create a table with 4 columns: name , value , operator, result Then i can put each rule in this table. My registration program then checks this table to see if its fields fit and if so does the rule apply? Here's the problem with this, what do i key the table on? I plan on this table growing to the 10s of thousands. If i have to scan this whole table this won't be feasible. Anyone have any suggestions or pointers (urls, books,...) Any help would be appreciated! David M Rosner