Select the All Technologies tab. In the New Gallery, in the Categories area, expand Business Tier and select In the New Gallery, in the Items area, select Business Rules. Click OK. Oracle JDeveloper displays the Create Business Rules dialog, as shown In t

9-6 Oracle Fusion Middleware Users Guide for Oracle Business Rules

11. In the grades.xsd file, select the Source tab.

12. Copy the schema shown in Example 9–1 to the grades.xsd in the Grades project, as shown in Figure 9–5 . Figure 9–5 Shows the Grades.xsd Schema File in the Grades Project To generate JAXB 2.0 content model from grades schema: 1. In the Application Navigator, in the Grades project expand Resources and select grades.xsd . 2. Right-click and in the context menu select Generate JAXB 2.0 Content Model.

3. In the JAXB 2.0 Content Model from XML Schema dialog, click OK.

9.2.4 How to Create an Oracle Business Rules Dictionary in the Grades Project

After creating a project in Oracle JDeveloper create business rules within the Grades project. To use business rules with Oracle JDeveloper, you do the following: ■ Add a business rule to the project and import grades.xsd schema ■ Create input and output variables ■ Create an Oracle Business Rules dictionary in the project To create a business rules dictionary in the business tier: 1. In the Application Navigator, select the Grades project. 2. Right-click and in the context menu select New....

3. Select the All Technologies tab.

4. In the New Gallery, in the Categories area, expand Business Tier and select

Business Rules .

5. In the New Gallery, in the Items area, select Business Rules.

6. Click OK. Oracle JDeveloper displays the Create Business Rules dialog, as shown

in Figure 9–6 . Creating a Rule-enabled Non-SOA Java EE Application 9-7 Figure 9–6 Adding a Business Rule to Grades with the Create Business Rules Dialog

7. In the Name field, enter a name to name the dictionary. For example, enter

GradingRules . 8. To add an input, from the list next to the Add icon select Input....

9. In the Type Chooser, expand the Project Schemas Files folder and expand

grades.xsd .

10. Select the input TestScore, as shown in

Figure 9–7 . Figure 9–7 Shows the Type Chooser Dialog with TestScore Element 9-8 Oracle Fusion Middleware Users Guide for Oracle Business Rules

11. On the Type Chooser window, click OK. This displays the Create Business Rules

dialog. 12. In the Create Business Rules dialog, in a similar manner to the input add the output by selecting Output... to add the output element TestGrade from the grades.xsd schema. The resulting Create Business Rules dialog is shown in Figure 9–8 . Figure 9–8 Create Business Rules Dialog with Grades Input and Output

13. Click OK. Oracle JDeveloper creates the GradingRules dictionary as shown in

Figure 9–9 .

14. In the File menu, select Save All to save your work.

Creating a Rule-enabled Non-SOA Java EE Application 9-9 Figure 9–9 Shows the New Grading Rules Dictionary Note that the business rule validation log area for the new dictionary shows several validation warnings. You remove these validation warning messages as you modify the dictionary in later steps.

9.3 Creating Data Model Elements and Rules for the Grades Sample Application

To create the data model and the business rules for the Grades sample application, you do the following: ■ Create Bucketsets for grades ■ Create rules by adding a Decision Table for grades ■ Split the Decision Table and add actions for rules ■ Rename the default decision function

9.3.1 How to Create Bucketsets for Grades Sample Application

In this example you associate a bucketset with a fact type. This supports using a Decision Table where you need bucketsets that specify how to draw values for each cell in the Decision Table for the conditions in the Decision Table. To create the bucketset for the grades sample application: 1. In Rules Designer, select the Bucketsets navigation tab.