Click Libraries and Classpath from the left panel and click the Add Library Click Oracle Rules and Oracle Rules Dictionary Component from the

25-32 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite try { writer = new FileWriternew FileruleFileName; dict.writeDictionarywriter; } catch SDKException e { System.err.printlne; return false; } catch FileNotFoundException e { System.err.printlne; return false; } catch IOException e { System.err.printlne; return false; } finally { if writer = null { try { writer.close; } catch IOException ioe { return false; } } } return true; } public static void updateDictionaryRuleDictionary dict { if dict == null return; ListSDKWarning warnings = new ArrayListSDKWarning; try { dict.updatewarnings; for SDKWarning warning : warnings System.out.printlnwarnings: + warning.getLocalizedMessage; } catch SDKException sdkEx { sdkEx.printStackTrace; } } You can call this method from your Save button public void saveDictionary { RuleDictionary dict = this.getRuleDictModel.getRuleDictionary; if dict = null { if dict.isModified updateDictionarydict; if dict.isTransactionInProgress saveDictionarydict, RULES_FILE1; } } call validation method on the ruleDictModel to update Validation Panel public void validate { if this.ruleDictModel == null return; Using Declarative Components and Task Flows 25-33 this.ruleDictModel.validate; } } 6. Open the faces-config.xml file in the Overview mode and click the + button under Managed Beans to display the Create Managed Bean dialog box. Point to SomeBean.java by providing the Bean Name as someBean and the Scope as session as shown in Figure 25–38 . Figure 25–38 Specifying the Bean Name and Scope The ADFJSF framework makes multiple calls to SomeBean.java to render the user interface. For example, someBean.ruleDictModel is called multiple times. So, it is better to create the RuleDictModel object once, cache it, and return it each time instead of re-creating it. To create the .jspx file for the Rules Dictionary Editor Component tag: The next task is to create the .jspx file to include the Rules Dictionary Editor Component tag. The steps are:

1. Open Oracle JDeveloper.

2. From the File menu, select New to display the New Gallery dialog box.

3. In the New Gallery dialog box, select JSF under Web Tier from the Categories

panel.

4. Select JSF Page under Items and click OK to display the Create JSF Page dialog

box.

5. In the Create JSF Page dialog box, enter useRuleDictDC.jspx as the file name

as shown in Figure 25–39 .