I need a simple rules engine, I think?

Andy :

I need some advice on the best approach to solving this problem.

I've researched DROOLS, Java Rule Engine and a few others. All of these are powerful, and have good things about them. I don't know which (if any) will be the best choice for me.

I have one business object. (simplified for demo)

Person
     firstName:String
     lastName:String
     departMent:String
     hireDate:Date

I need to write an editor in a web application that will allow for complex rules to be built around these fields. I need to support complex nested AND/OR logic. I just need basic operators, and the rule should simply evaluate to true or false. If the rule evaluates to true or false, one action will occur respectively.

For example,

firstName CONTAINS "value" AND (lastName EQUALS "input" OR department CONTAINS "input")

I had thought, maybe I should just write my own parser and evaluate the logic in my own code. I don't know what to do, any advice or links to something to read would be greatly appreciated. Is there a specific design pattern I could research?

How would you solve this problem? One reservations about the rules engines is that maybe they are too complex for just a simple problem?

CMR :

This is not an yes/no question, but I can probably share my experiences, and hope it helps. I have used DROOLS quite successfully in a few projects. Apart from some cases (another team had issues with DROOLS under heavy load,) DROOLS is quite an useful library.

I built an application which:
1. read input from a source
2. chose the next action based on the input from a set of available operations

As trivial as it looks, it needed to be very flexible:
1. The input was a variable set of name-value pairs, names not predetermined.
2. values, presence/absence of certain name/values (based on occurrence/absence of events), trigger different actions.
3. The business rules can change while the application is running.

Maybe there are better solutions, but for better or worse, I ended up using DROOLS. I developed a BPEL in which the decisions are made by the DROOLS component. The DROOLS component internally reads the decision making rules from a Microsoft Excel spreadsheet. It rebuilds the rules if there is a change in the file. Now the domain experts change this spreadsheet when required, and we do not go through painful deployments!

If you want a sophisticated UI, DROOLS Guvnor is a readily available web-application (with rich UI,) which would help your domain/subject-matter experts to build rules and store them in a database.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Made a simple calculator but I need to add something to it

Very simple prime number test - I think I'm not understanding the for loop

Simple (I think) Horizontal Line in WPF?

Do I need to 'keep' Parcelable in proguard rules while obfuscating

Do I need to Setup a Reverse Proxy behind Google App Engine or not?

Why do I need these proguard rules for Google Play Services

Why do I need brackets for simple expression?

I think I need to pass props to child component?

SQL Server : need help write what i think should be a simple code

I think i need a SQL Loop for calculation

Which target in debian/rules do I need to use for generating documentation?

CoffeeScript - simple loop doesn't execute as I think it should

Google app engine or do i need Google apps script?

Xcode error(I think)?

I need help at a simple while loop

Do I need a search engine for a model with 20+ attributes

I need rules to drop some malicious Apache connections

I think I need a static class with a constructor?

Output is stopped because of & (ampersand). I need to enclose each line of output in quotes? I think?

I need advice for iptables rules

Do I need to restore iptable rules everytime on boot?

Do I need an app.yaml for my App Engine project?

Why would i need to add scripting engine in my standalone applications

I'm building googlemap tracking for my app and I'm stuck for over five days now on, I think ,,simple'' problem

I need a simple css code for navigation bar

Are there any other considerations I need to think about for Login screen in ASP.NET?

I need to track changes to files, but I cannot think of a way

SQL Help - Think I need a subquery

I have to list first and last name of staff and I think I need to join three different tables