Showing posts with label Business Rules. Show all posts
Showing posts with label Business Rules. Show all posts

Friday, 11 March 2016

SOA Composer which is used to modify Business Rules is not opening up


When we are trying to open SOA Composer using URL http://localhost:7001/soa/composer from browser we are getting Error 404-Not Found.



This is because composer in console is in installed state not in an active state as shown below.



When we are trying to make it active we are getting a warning Application composer does not have any targets.





We can clearly see from below image that composer is not targeted to any server.



In order to remove this warning we need to set the target of composer to Admin Server.











We are targeted the composer to Admin server successfully and now we can see the state of composer as Active and Health as OK.



Now try to open the URL http://localhost:7001/soa/composer you are able to see SOA composer screen as below. 



Thank You!!!!


Happy Learning!!!!


Thursday, 10 March 2016

Credit Card Validation Using Ruleset Decision Table in Business Rules

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

a)If Amount less than 25000 then set the result to "Bronze Card"
b)If Amount greater than or equal to 25000 and Amount less than 50000 then set the result to "Silver Card"
c) If Amount greater than or equal to 50000 and Amount less than 75000 then set the result to "Gold Card"
d) If Amount greater than or equal to 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. Add all the List of Values and List of Ranges in the Bucketset.



Adding List Of Ranges

a) Amount < 25000
b) Amount >= 25000 and Amount < 50000
c) Amount >= 50000 and Amount < 75000
d) Amount >= 75000







Adding List of Values

a) "Bronze Card" b) "Silver Card" c) "Gold Card" d) "Platinum Card"







8. Modifying the Facts input(process) with List of Ranges(CreditCardRange) and output(processResponse) with List of Values(CreditCardList) in Bucketset field as shown below.





9. Create a Ruleset using Decision Table.



10. Add the following conditions and actions by creating a Rule inside the Decision Table

Conditions

a) Amount < 25000 b) Amount >= 25000 and Amount < 50000 c) Amount >= 50000 and Amount < 75000 d) Amount >= 75000

Actions: Set these actions as parametrized.

a) "Bronze Card" b) "Silver Card" c) "Gold Card" d) "Platinum Card"

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".



11. 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!!!!


Tuesday, 8 March 2016

Testing Business Rules at Design Time



1. Double click on Business Rule Component.



2. Inside the functions create your own function by clicking on + button



3. Create a new function with
   
    Name: CreditCardValidationTest
    Return Type: Boolean
    BucketSet: Boolean
    Description: Internal Testing



4. Add the below content inside the body.





5. Now you are ready to test.Click on the test button which is highlighted below.



6. Result



7. To enable log we will call the following statement.

call RL.watch.all();



8. Result after enable a log.



Thank You!!!!

Happy Learning!!!!