How to Add the Employee Raises Java Class

10-36 Oracle Fusion Middleware Users Guide for Oracle Business Rules

10.3.10.6 How to Add the Employee Raises Java Class

Add the employee raises class. This executes the decision function. To add the employee raises class: 1. Select the Chapter10 project. 2. Right-click and select New.... 3. In the New Gallery, in the Categories area select General. 4. In the New Gallery, in the Items area, select Java Class. 5. Click OK. 6. In the Name field, enter EmployeeRaises. 7. Click OK. 8. Replace the contents of this class with the code shown in Example 10–11 . Example 10–11 DeptManagerFinder Class package com.example; import oracle.jbo.ApplicationModule; import oracle.jbo.ViewObject; import oracle.jbo.client.Configuration; import oracle.jbo.server.DBTransactionImpl2; import oracle.rules.rl.exceptions.RLException; import oracle.rules.sdk2.decisionpoint.DecisionPoint; import oracle.rules.sdk2.decisionpoint.DecisionPointBuilder; import oracle.rules.sdk2.decisionpoint.DecisionPointInstance; import oracle.rules.sdk2.exception.SDKException; import oracle.rules.sdk2.repository.DictionaryFQN; public class EmployeeRaises { private static final String AM_DEF = com.example.AppModule; private static final String CONFIG = AppModuleLocal; private static final String VO_NAME = EmployeesView1; private static final String DF_NAME = EmployeeRaises; private static final DictionaryFQN DICT_FQN = new DictionaryFQNcom.example, Chapter10Rules; private DecisionPoint dp = null; public EmployeeRaises { try { dp = new DecisionPointBuilder .withDICT_FQN .withDF_NAME .build; } catch SDKException e { System.err.printlne; } } public void run { final ApplicationModule am = Working with Oracle Business Rules and ADF Business Components 10-37 Configuration.createRootApplicationModuleAM_DEF, CONFIG; final ViewObject vo = am.findViewObjectVO_NAME; final DecisionPointInstance point = dp.getInstance; point.setTransactionDBTransactionImpl2am.getTransaction; point.setAutoCommittrue; point.setViewObjectvo; try { point.invoke; } catch RLException e { System.err.printlne; } catch SDKException e { System.err.printlne; } for DecisionPoint.NamedValue result : point.getResults{ System.out.printlnresult.getName + + result.getValue; } } public static void mainString[] args { new EmployeeRaises.run; } }

10.3.10.7 How to Copy Dictionary