Advertisement
tko_pb

CallGenerateBPAutoSearchKeyCallout

Jan 28th, 2019
338
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.12 KB | None | 0 0
  1. package org.wirabumi.gen.oez.callout;
  2.  
  3. import org.openbravo.erpCommon.ad_callouts.SimpleCallout;
  4. import org.openbravo.erpCommon.utility.Utility;
  5.  
  6. public class CallGenerateBPAutoSearchKeyCallout extends SimpleCallout {
  7.  
  8.     @Override
  9.     protected void execute(CalloutInfo info) {
  10.         try {
  11.             //getParameter
  12.             String bpSearchKeyRule = Utility.getPreference(info.vars, "bpSearchKeyRule", null);
  13.             boolean strValid = bpSearchKeyRule !=null && !bpSearchKeyRule.isEmpty();
  14.  
  15.             if(!strValid) {
  16.                 return;
  17.             }
  18.             Class cls = Class.forName(bpSearchKeyRule);
  19.             Object clsInstance = (Object) cls.newInstance();
  20.             GenerateBPSearchKey concrete = null;
  21.             concrete = (GenerateBPSearchKey) clsInstance;
  22.             String searchKey = concrete.getBPSearchKey(info);
  23.             info.addResult("inpvalue", searchKey);
  24.            
  25.            
  26.         }catch (ClassNotFoundException e) {
  27.             // TODO Auto-generated catch block
  28.             e.printStackTrace();
  29.         } catch (InstantiationException e) {
  30.             // TODO Auto-generated catch block
  31.             e.printStackTrace();
  32.         } catch (IllegalAccessException e) {
  33.             // TODO Auto-generated catch block
  34.             e.printStackTrace();
  35.         }
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement