[rules-users] Filtering eligible records for authorization - Is a rules engine right solution ?

gmkumar2005 gmkumar2005 at gmail.com
Wed Jul 13 09:39:13 EDT 2011


I have an authorization screen for say payments

A list of transactions is displayed. This is a filtered list. Each
transaction listed in this screen needs to satisfy following conditions

A) Meets Authorization Verification Matrix (AVM) conditions

B) .. few more conditions not imp at this time

In simplest form AVM is defined as below

Below 5000 -- ApproverRole
Above 5000 -- SeniorApproverRole
Hence if the loggedIn user belongs to ApproverRole , all the transactions
which are below 5000 should be displayed.

I am trying to solve this problem using drools.

Proposed solution.

Create a rule "AVMRULE"
Each payment is modeled as a FACT.
Payment has two interesting properties 1) amount 2) isEligible

When payment object is asserted into working memory the "AVMRULE" modifies
the payment.isEligible. The user interface displays or hides the transaction
based on payment.isEligible

*Problem :* Average number of payments in a system can go up to a million.
The above solution implies that the application has to fetch all the million
records to the business layer.

It can be optimized to fetch batch of records and stop reading as soon as we
find first 10 records which have isEligible true. This works if the user
wants to see first page. Doesn't work if he wants to see the last page. I am
not sure if overall performance will improve in a multi-user environment
at-least 20 concurrent users

*Question :* Please note the problem is to display the filtered list. Also
consider that there are more conditions to handle and AVM is much complex
than what is defined above.

Is rules engine appropriate to solve this problem ?

--
View this message in context: http://drools.46999.n3.nabble.com/Filtering-eligible-records-for-authorization-Is-a-rules-engine-right-solution-tp3165981p3165981.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list