How to Create Data Model Elements for Use with a Decision Point

Working with Rules SDK Decision Point API 7-3

3. In the Open dialog select CarRentalApplication.jws and click Open.

4. In the Application Navigator, expand the CarRentalApplication, expand

Application Sources and Resources. This displays the Oracle Business Rules dictionary named CarRental.rules and several Java source files.

7.2 Creating a Dictionary for Use with a Decision Point

The car rental sample uses the Rules SDK Decision Point API with either a pre-loaded Oracle Business Rules dictionary or a repository stored in MDS. When you are working in a development environment you can use the Decision Point API with the pre-loaded dictionary signature. In a production environment you would typically use a Decision Point with the MDS repository signature. The CarRental dictionary is pre-defined and is available in the car rental sample application. To work with the Decision Point API you need to create a dictionary that contains a decision function the car rental sample application comes with a predefined dictionary and decision function. You perform the following steps to create a dictionary and a decision function: ■ Section 7.2.1, How to Create Data Model Elements for Use with a Decision Point ■ Section 7.2.2, How to View a Decision Function to Call from the Decision Point ■ Section 7.2.3, How to Create Rules or Decision Tables for the Decision Function

7.2.1 How to Create Data Model Elements for Use with a Decision Point

You need the following to add to a decision function when you create an application with a Decision Point. ■ A dictionary containing data model elements that you use to create rules or Decision Tables and when working with ADF Business Components fact types, you need to add links for the Decision Point support dictionary. For more information, see Chapter 2, Working with Data Model Elements . For more information, see Chapter 10, Working with Oracle Business Rules and ADF Business Components . ■ A dictionary containing fact definitions. For more information, see Chapter 3, Working with Facts and Bucketsets . To view the data model in the supplied car rental sample application: 1. In Rules Designer, click the Facts navigation tab. 2. Select the Java Facts tab, as shown in Figure 7–1 . The Java Facts tab shows four fact types imported, in addition to the fact types provided as built-in to the dictionary. The Driver Java Fact is imported from the Driver Java class in the project. The Denial Java Fact is imported from Denial Java class in the project. The LicenseType and VehicleType facts are imported from the nested enum classes defined in the Driver class. 7-4 Oracle Fusion Middleware Users Guide for Oracle Business Rules Figure 7–1 Defined Java Facts for the Car Rental Sample Application When you use a Decision Point with Rules SDK, you call a decision function in a specified dictionary. The decision function that you call can contain one or more rulesets that are executed as part of the Decision Point. To view the ruleset in the supplied car rental sample application: 1. In Rules Designer, expand the CarRentalApplication. 2. In the CarRentalApplication, expand Resources. 3. Double-click the CarRental.rules.

7.2.2 How to View a Decision Function to Call from the Decision Point