We help IT Professionals succeed at work.

Need help on decision table structure

sakthikumar
sakthikumar asked
on
118 Views
Last Modified: 2017-03-23
I want to create a table by which we should be able to implement complex business rules.

simple eg:

(test1 = pass or (test2 = fail and test3 = pass))
or (test4 = fail or test5 = pass)

test1,test2,test ... test5 are columns in a table.
pass and fail are values.

what should be the table structure to implement these rules?
Comment
Watch Question

Sean StuberDatabase Developer & Administrator
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2012

Commented:
not enough information yet.

Does every rule consist of the same 5 tests?  if so, all 5 should be distinct columns in a single table.
You might want to consider this structure even if some rules might be missing a couple and simply null them.
(rule_id, test1, test2,test3,test4,test5)


Could each rule have a varying number of tests, possibly even more than 5, and the which types of tests can vary as well?
If so test types should be a separate table and each rule should have one or more rows that join to the test table.

(test_id,  test_description)
(rule_id, test_id, test_result)

Author

Commented:
I have a table with columns test1 to test5 and more columns.
rule could be based on any one of these columns.

Also in the rule table, there should be a column to store operator(">","<" ...)

I am just confused like how to handle nested conditions
If there are Parent conditions / child conditions like multiple "OR" and "AND". In this case,  what should be the procedure
for this rule
Sean StuberDatabase Developer & Administrator
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2012

Commented:
I'm not sure I understand.

I think you might just want a large text column (like varchar2(4000))  to hold the text of your rule
Then you could simply evalute it with substitution

Author

Commented:
I'm sorry I didn't explain you clearly. I am creating a front end application in apex for creating rules.
I will be having an option to select the column name (from table. this could be test1 or test2 or any column)
                                          then to choose operator (> < = etc.,)
                                          then to choose value ('pass','fail' ...)
what should be the table design to build rule like below.

(test1 = pass or (test2 = fail and test3 = pass))
or (test4 = fail or test5 = pass)
Database Developer & Administrator
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2012
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
This I can do, but users may not be able to write condition.

if there is something like dropdown available for rule creation, it will be easy for them.

and If I know in which table structure I can store this rule, I can design a front end for them.
johnsoneSenior Oracle DBA
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.