Monday 7 March 2016

Credit Card Validation Using Ruleset If/Then in Business Rules

Lets create sample business rules application for credit card validation based on the following condition.

a)If Amount less than or equal to 25000 then set the result to "Bronze Card"
b)If Amount greater than 25000 and Amount less than or equal to 50000 then set the result to "Silver Card"
c) If Amount greater than 50000 and Amount less than or equal to 75000 then set the result to "Gold Card"
d) If Amount greater than 75000 then set the result to "Platinum Card"

1. Create a New SOA Application CreditCardValidationApplication.



2. Create a new project CreditCardValidationProject inside CreditCardValidationApplication.





3. Drag drop BPEL and create synchronous BPEL Process.





4. Modify the schema element name input to Amount.



5. Drag drop Business Rules component and name it as CreditCardValidationRules.















6. Drag and drop Business Rule next to BPEL process in the composite, connect BPEL process with the Rules Engine.







7. Edit the rules by creating the following conditions

a. If Amount <= 25000 then send the response as "Bronze Card"
b. If Amount > 25000 and Amount <= 50000 then send the response as "Silver Card"
c. If Amount > 50000 and Amount <= 75000 then send the response as "Gold Card"
d. If Amount > 75000 then send the response as "Platinum Card"















8. Edit the BPEL process, add the rules engine and edit this to pass input parameter as process request (Amount) and output parameter as process response (result).

















Now ready to deploy, deploy and test will get appropriate results.


Thank You!!!!


Happy Learning!!!!



No comments:

Post a Comment