Click the Resize All Columns to Same Width icon. In the Decision Table, select a rule with OrderApproval status action set to In the Conditions area, for the three conditions leave the - do not care value for In the Actions area, enter Status.MANUAL, as s

Working with Decision Tables 5-41 3. For each action cell, enter the appropriate value as determined by the logic of your application. For this sample application use the values for the Decision Table actions as shown in Table 5–5 .

4. Select Save All from the File main menu to save your work.

5.4.7.2 Compact the Decision Table

In this step you compact the rules to merge from eighteen rules to nine rules. This automatically eliminates the rules that are not needed and preserves the no gap, no conflict properties for the Decision Table. To compact the decision table: 1. Select the Decision Table.

2. Click the Resize All Columns to Same Width icon.

3. Click the Compact Table icon and from the list select Compact Table. The compact

table operation eliminates rules from the Decision Table. The Decision Table now shows nine rules, as shown in Figure 5–38 . Table 5–5 Values for Decision Table Actions Rule C1 creditScore C2 order C3 annualSpending 2000 A1 OrderApproval status R1 risky Low true Status.MANUAL R2 risky Low false Status.MANUAL R3 risky Medium true Status.MANUAL R4 risky Medium false Status.REJECTED R5 risky High true Status.MANUAL R6 risky High false Status.REJECTED R7 avg Low true Status.APPROVED R8 avg Low false Status.MANUAL R9 avg Medium true Status.APPROVED R10 avg Medium false Status.MANUAL R11 avg High true Status.MANUAL R12 avg High false Status.MANUAL R13 solid Low true Status.APPROVED R14 solid Low false Status.APPROVED R15 solid Medium true Status.APPROVED R16 solid Medium false Status.APPROVED R17 solid High true Status.APPROVED R18 solid High false Status.MANUAL 5-42 Oracle Fusion Middleware Users Guide for Oracle Business Rules Figure 5–38 Compacting a Decision Table Using Compact Table

5.4.7.3 Replace Several Specific Rules with One General Rule

Notice that five of the nine remaining rules result in a manual order approval status. You can reduce the number of rules by deleting these five rules. Note it is often best practice to not do this that is not replace several specific rules with one general rule. You need to compare the benefits of having fewer rules with the added complexity of managing the conflicts introduced when you reduce the number of rules. To replace several specific rules with one general rule: 1. Select the Decision Table.

2. In the Decision Table, select a rule with OrderApproval status action set to

Status.MANUAL . To select a rule, click the column heading. For example, click rule R2 as shown in Figure 5–39 .

3. Click Delete to remove a rule in the Decision Table. Be careful to click the delete

icon in the Decision Table area to delete a rule in the decision table there is also a delete icon shown in the Ruleset area that deletes the complete Decision Table. Working with Decision Tables 5-43 Figure 5–39 Deleting Rules from a Decision Table 4. Repeat these steps to delete all the rules with action set to Status.MANUAL. This should leave the Decision Table with four rules as shown in Figure 5–40 . Figure 5–40 Decision Table After Manual Actions Removed

5.4.7.4 Add a General Rule

Now you can add a single rule to handle the manual case. After adding this rule you set the conflict policy with the option Conflict Policy auto override for conflict resolution. To add a general rule: 1. In the Decision Table, click the Add icon and from the list select Rule. 5-44 Oracle Fusion Middleware Users Guide for Oracle Business Rules

2. In the Conditions area, for the three conditions leave the - do not care value for

each cell in the rule.

3. In the Actions area, enter Status.MANUAL, as shown in

Figure 5–41 . Notice that the Business Rule Validation log includes the warning RUL-05851 for unresolved conflicts. Figure 5–41 Decision Table with Conflicting Rules

4. Show the conflicting rules by clicking the Toggle Display of Conflict Resolution

icon, as shown in Figure 5–42 . Working with Decision Tables 5-45 Figure 5–42 Adding a Rule to Handle Status Manual To enable the auto override conflict resolution policy: 1. In the Decision Table click Show Advanced Settings the icon next to the Decision Table name.

2. In the Conflict Policy list, select auto override. After adding the manual case rule

and selecting auto override, notice that the conflicts are resolved and special cases override the general case, as shown in Figure 5–43 . Figure 5–43 Adding a Rule to Handle Status Manual with Auto Override Conflict Policy 5-46 Oracle Fusion Middleware Users Guide for Oracle Business Rules

5.4.8 How to Check the Business Rule Validation Log for Order Approval

Before you can deploy the application you need to make sure the dictionary validates without warnings. If there are any validation warnings you need fix any associated problems. To validate the dictionary: 1. In the Business Rule Validation Log, check for validation warnings. 2. If there are validation warnings, perform appropriate actions to correct the problems.

5.4.9 How to Deploy the Order Approval Application

Business rules created in an SOA application are deployed as part of the SOA composite when you create a deployment profile in Oracle JDeveloper. You deploy an SOA composite application to Oracle WebLogic Server. To deploy and run the order approval application: 1. If you have not started your application server instance, then start the Oracle WebLogic Server.

2. In the Application Navigator, right-click the OrderApproval project and select

Deploy OrderApproval to WLS Server Name. Then the SOA Deployment Configuration dialog displays.

3. Click OK.

4. In the Authorization Request dialog, enter your authorization.

5. Click OK.

5.4.10 How to Test the Order Approval Application

After deploying the application you can test the Decision Table in the SOA composite application with the Oracle Enterprise Manager Fusion Middleware Control Console. To test the application: 1. Open the composite application in Oracle Enterprise Manager Fusion Middleware Control Console, as shown in Figure 5–44 .