From the File menu, select New and then Generic Application to create an Enter a name for the application in the Application Name field, for example,

25-30 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite Figure 25–37 Creating a Java Class 5. In SomeBean.java, provide a method that returns the RuleDictionaryModel object. You must specify the location of the rules file here. The following is a sample of the SomeBean.java file: package useruledictdc; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.Reader; import java.io.Writer; import java.util.ArrayList; import java.util.List; import oracle.bpel.ruledictionarydc.model.impl.RuleDictionaryModel; import oracle.rules.sdk2.dictionary.DictionaryFinder; import oracle.rules.sdk2.dictionary.RuleDictionary; import oracle.rules.sdk2.exception.SDKException; import oracle.rules.sdk2.exception.SDKWarning; public class SomeBean { private RuleDictionaryModel ruleDictModel; private static final String RULES_FILE1 = C:\\scratch\\asuraj\\system\\rules\\OrderBookinRules.rules; public SomeBean { super; } public RuleDictionaryModel getRuleDictModel { if ruleDictModel = null return ruleDictModel; cache ruleDictModel instead of re-creating it each time Using Declarative Components and Task Flows 25-31 ruleDictModel = new RuleDictionaryModelgetRuleDictionary; return ruleDictModel; } public RuleDictionary getRuleDictionary { Reader reader = null; try { reader = new FileReadernew FileRULES_FILE1; } catch FileNotFoundException e { LOG.severee; System.err.printlne; } RuleDictionary dict = openRulesDictreader, null; if reader = null { try { reader.close; } catch IOException ioe { } } return dict; } private static RuleDictionary openRulesDictReader reader, DictionaryFinder finder { RuleDictionary dict = null; try { dict = RuleDictionary.readDictionaryreader, finder; } catch SDKException e { System.err.printlne; } catch FileNotFoundException e { System.err.printlne; } catch IOException e { System.err.printlne; } catch IllegalArgumentException e { System.err.printlne; } finally { } return dict; } refer to Rules SDK documentation for saving a dictionary also because this code does not take care of saving linked dictionaries public static boolean saveDictionaryRuleDictionary dict, String ruleFileName { if dict == null || ruleFileName == null return false; if dict.isTransactionInProgress System.out.printlnTransaction in progress, cannot save dictionary; Writer writer = null;