Oracle Business Rule is a lighweight SOA component used to write all business requirement rules in a single page. We can write and maintain the rules using Oracle Rules GUI editors. This can be understandable by the business peoples and also they can direct modify the rules.
There are two different ways to write a Rule.
- IF .. THEN Ladder
- Decision Table
Below is an example of how to use Decision table and List of Values Busketset.
Example :
Depending upon the salary value of an employee a Business rule will give the output the salary Grade of that employee. Follow the below steps to create a Decision table for this simple requirement.
- Create a Synchronous BPEL process as DecisionTableDemo.
- In the composite drag a Business Rule Component.
- Configure the Input and Output messages of the businessa Rule.
- Connect the Business Rule Component to the BPEL component.
- Double Click on the Rule component to write rules. Select the decision Table approach.
- Create a busketset and attach it to the processResponse fact. Bucketset is nothing but a set of values which we can use directly with any fact instead of typing the value again and again.
- Select the above created bucketSet and click on edit button. Enter the list of values in that bucketset.
- Attach the bucketset with ProcessResponse fact. Go to the Fact tab and click on the processResponse fact. Click edit button and in the below part select the bucketset field.
- Click on the RuleSet1 and enter the Decision table rules. Configure the Condition and Action at first then we need to enter the multiple rules for the same.
- Now enter the Rules. If the salary is 1000 then the result should be Grade-C, If 2000 result will Grade-B and so on. In the below sanpshot ad we attached the Grade-A,Grade-B, Grade-c in the bucketset and same we attached to the process response while designing it will display the list of values so no need to type one these again and again, we just need to choose one value from the list.
- The Rule component is configured. Need to call the same from BPEL. Go to the BPEL compnent by double click on the BPEL. The Business Rule will display as a synchronous partner link.Drag a Rule component into the bpel process as shown below.
- Select the Rules dictionary which we created before.
- Double click on the Rules activity and configure the input and output messages.
- This will automatically create the assign and invoke activities. Expand the Rules activity we will get the below activities created automatically by BPEL.
- Now deploy the project and test.
To Modify the Deployed Business Rule from Oracle SOA Composer follow the below link.
Give your feedback on the same. Happy Coding :)
Thanks for sharing Good Information
ReplyDeleteOracle SOA Online Training Hyderabad