About Using the Oracle JDeveloper 11g Migration Wizard for Oracle SOA Suite Applications

9-4 Oracle Fusion Middleware Upgrade Guide for Oracle SOA Suite, WebCenter, and ADF

9.3.1.1.2 Accessing a Dictionary in the Development Environment In Oracle Business Rules

10g, it was common for an application developer to use a file-based repository while developing the application, and then switch to using a WebDAV repository for production. In Oracle Business Rules 11g, you can instead access the rule dictionary file directly before it is packaged into a format which can be deployed to MDS. In the following examples, compare the code required to access a dictionary in development mode in 10g Example 9–1 with the code required in 11g Example 9–2 . Note that in general, you should use the Decision Point API rather than continuing to access the RuleRepository directly. Example 9–1 Accessing a Dictionary with Oracle Business Rules 10g in a Development Environment String path; the path to the file repository Locale locale; the desired Locale The following code assumes that the path and locale have been set appropriately RepositoryType rt = RepositoryManager.getRegisteredRepositoryTypeoracle.rules.sdk.store.jar; RuleRepository repos = RepositoryManager.createRuleRepositoryInstancert; RepositoryContext rc = new RepositoryContext; rc.setLocalelocale; rc.setPropertyoracle.rules.sdk.store.jar.path, path; repos.initrc; Example 9–2 Accessing a Dictionary with Oracle Business Rules 11g in a Development Environment protected static final String DICT_LOCATION =C:\\scratch\\CarRental.rules; ... RuleDictionary dict = null; Reader reader = null; try { reader = new FileReadernew FileDICT_LOCATION; dict = RuleDictionary.readDictionaryreader, new DecisionPointDictionaryFindernull; ListSDKWarning warnings = new ArrayListSDKWarning; dict.updatewarnings; if warnings.size 0 { System.err.printlnValidation warnings: + warnings; } } catch SDKException e{ System.err.printlne; } catch FileNotFoundException e{ System.err.printlne; } catch IOException e{ System.err.printlne; } finally { if reader = null { try { reader.close; } catch IOException ioe {ioe.printStackTrace;} } }

9.3.1.1.3 Accessing a Repository in a Production Environment In Oracle Business Rules 10g,

WebDAV was the recommended production repository. Considerations When Upgrading All Oracle SOA Applications 9-5 In Oracle Business Rules 11g, WebDAV is no longer supported and Metadata Services MDS is the recommended repository. Also, the dictionary name and version have been replaced with a package and name similarly to the Java class naming scheme. In Oracle Business Rules 10g, the version did not provide true versioning. In Oracle Business Rules 11g, the equivalent to specifying a version is to simply change the name. For example, a 10g dictionary with the name foo.bar.MyDict and version 2 would in 11g be packaged as foo.bar and name MyDict2. In the following examples, compare the code required to access a dictionary in production mode in 10g Example 9–3 with the code required in 11g Example 9–4 . Example 9–3 Accessing a Dictionary with Oracle Business Rules 10g in a Production Environment String url; the URL for the WebDAV repository Locale locale; the desired Locale The following code assumes that the url and locale have been set appropriately RepositoryType rt = RepositoryManager.getRegisteredRepositoryTypeoracle.rules.sdk.store.webdav; RuleRepository repos = RepositoryManager.createRuleRepositoryInstancert; RepositoryContext rc = new RepositoryContext; rc.setLocalelocale; rc.setPropertyoracle.rules.sdk.store.webdav.url, url; repos.initrc; RuleDictionary dictionaryWithInitialVersion = repos.loadDictionarydictionaryName; RuleDictionary dictionarySpecificVersion = repos.loadDictionarydictionaryName, dictionaryVersion; Example 9–4 Accessing a Dictionary with Oracle Business Rules 11g in a Production Environment import static oracle.rules.sdk2.repository.RepositoryManager.createRuleRepositoryInstance; import static oracle.rules.sdk2.repository.RepositoryManager.getRegisteredRepositoryType; import static oracle.rules.sdk2.store.mds.Keys.CONNECTION; ... private static final String DICT_PKG = oracle.middleware.rules.demo; private static final String DICT_NAME = CarRental; private static final DictionaryFQN DICT_FQN = new DictionaryFQNDICT_PKG, DICT_NAME; ... RuleRepository repo = createRuleRepositoryInstancegetRegisteredRepositoryTypeCONNECTION; repo.initnew RepositoryContext {{ setDictionaryFindernew DecisionPointDictionaryFindernull; }}; RuleDictionary dict = repo.loadDICT_FQN;

9.3.1.1.4 Generating RL Code The following example shows the code required generate

RL code in Oracle Business Rules 10g. In 11g, this code remains the same. init a rule session String rsname = vehicleRent; String dmrl = dict.dataModelRL; String rsrl = dict.ruleSetRL rsname ;