Here I will show you how to create and use decision table using business rule.
Input: id, name, designation (like PAT, A, SA, M etc.).
Output: eligible_trutime_topup_per_fortnight (like 10,20,0 etc.)
Step1: Create SOA Project.
Now project created.
Step2: Drag and drop bpel process and select synchronous process.
Now bpel created as like below.
Step3: Prepare schema as per your requirement.
Step4: Drag and drop business rules component.
Now you can import schema input and output.
Import input schema.
Input schema imported successfully, now import output
schema.
Both schema’s imported successfully.
Step5: Double click business rules.
Create decision tables.
Now decision table like below.
Select process Designation like below.
Click Actions and hard code the top up value.
After hard coding the value diagram like below.
Create another rule and give remaining conditions like
below.
After creating all condition rules diagram like below.
Step6: Double click bpel process and add BusinessRules.
Double click rules and and select Business rules.
After selection now showing like below image.
Click ok, now composite automatically invoke business rules
and created activities.
Step7: Deploy the
composite and test.
Testing:
Input:
<?xml version="1.0"
encoding="UTF-8"?><inputVariable>
<part
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
name="payload">
<ns1:process
xmlns:ns1="http://xmlns.oracle.com/POC/DecisionTable_Poc/BPELProcess1">
<ns1:ID>12345</ns1:ID>
<ns1:NAME>Suri</ns1:NAME>
<ns1:DESIGNATION>A</ns1:DESIGNATION>
</ns1:process>
</part>
</inputVariable>
Output:
<?xml version="1.0"
encoding="UTF-8"?><outputVariable>
<part
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
name="payload">
<processResponse
xmlns="http://xmlns.oracle.com/POC/DecisionTable_Poc/BPELProcess1">
<EligibleTopup>15</EligibleTopup>
</processResponse>
</part>
</outputVariable>