How to Create Rules or Decision Tables for the Decision Function What You Need to Know About Using Car Rental Sample with a Decision Table

7-6 Oracle Fusion Middleware Users Guide for Oracle Business Rules Figure 7–3 Car Rental Decision Function for the Car Rental Sample Application

7.2.3 How to Create Rules or Decision Tables for the Decision Function

The car rental sample includes two rulesets, one with IFTHEN rules and another containing a Decision Table. You can use either IFTHEN rules or Decision Tables or both in your application if you are using a Decision Point. To view the rules in the car rental sample application: 1. In Rules Designer click the Denial Rules:if-then ruleset, as shown in Figure 7–4 . Working with Rules SDK Decision Point API 7-7 Figure 7–4 Ruleset with IFTHEN Rules for the Car Rental Sample Application The Denial Rules:if-then ruleset includes two rules: ■ under age : this rule defines the minimum age of the driver. The rule compares the Driver instance age property to the global Minimum driver age. If the driver is under this age, then a new Denial fact is asserted. A call to the decision function collects this Denial fact, as defined in its output. The rule also calls a user-defined function, audit, to provide some auditing output about why the Denial is created. ■ too many accidents : this rule defines an upper threshold for the number of accidents a driver can have before a rental for the driver is denied. The rule also calls a user-defined function, audit, to provide some auditing output about why the Denial is created. To view the Decision Table in the car rental application: 1. In Rules Designer, click the Denial Rules:decision table ruleset, as shown in Figure 7–5 . 7-8 Oracle Fusion Middleware Users Guide for Oracle Business Rules Figure 7–5 Ruleset with Decision Table for the Car Rental Sample Application

7.2.4 What You Need to Know About Using Car Rental Sample with a Decision Table

The car rental sample application includes the Denial Rules: decision table ruleset. To switch to use a Decision Table in the supplied decision function sample, move the Denial Rules:if-then from the Selected area in the decision function and add the Denial Rules: decision table ruleset, which uses a Decision Table to define similar rules, as shown in Figure 7–6 . Working with Rules SDK Decision Point API 7-9 Figure 7–6 Decision Function for Car Rental Sample with Decision Table Ruleset

7.3 Creating a Java Application Using Rules SDK Decision Point

When use Rules SDK in a development environment you of the option of using Decision Point API with a pre-loaded dictionary. In a production environment you typically use the Decision Point API with the MDS repository signature and the dictionary is stored in MDS. For more information on using a Decision Point with, see Section 7.5, What You Need to Know About Using Decision Point in a Production Environment . The source code for Oracle Business Rules-specific samples is available online at https:www.samplecode.oracle.comsfgopage1497 For SOA samples online visit https:www.samplecode.oracle.comsfprojectssoasamples The CarRentalProject project includes the com.example.rules.demo package that includes the car rental sample file, CarRentalWithDecisionPointUsingPreloadedDictionary.java. The project also includes several .java source files that support different variations for