OPM Recipe designer notes


Published on

This document is about OPM's recipe designer functionality, which is a typical example
about customized java applet usage in Oracle forms. Enjoy it.

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

OPM Recipe designer notes

  1. 1. GMD Designer --for Recipe/Formula/Routing1, Forms and Designer Communication2, Designer Code Analysis3, Debugging4, Setup5, Testing1, Forms and Designer Communication1.1), From Forms to Designer:In design phase, create a Bean Area type item in forms and set its class as oracle.apps.fnd.formsClient.AppletAdapter,it behaves as a middle man between applet and forms. For example GMDRCDSG.fmb, GMDRTDSG.fmbUse package FNDAPLT to init applet, in the following way for example: FNDAPLT.Applet_Init( DESIGNER.BEANAREA, GMDREDSG01, oracle.apps.gmd.recipeDesigner.javaui.RecipeDesigner, l_paramlist);During runtime, forms communicates with applet by the following way: SET_CUSTOM_ITEM_PROPERTY(DESIGNER.BEANAREA, %, GMDREDSG01:OPEN_RECIPE: ||:||:PARAMETER.CUR_RECIPE_ID);Note: In the following, RecipeDesigner.setProperty method will be called.1.2), From Designer to FormsDesigner communicates with Forms by using java class UserAreaSender to send messages, sample code: private void callFormRefreshRecipeId(String recipeId) { if (m_uaSender != null) { m_uaSender.removeAll(); m_uaSender.add(recipeId); m_uaSender.send("CALL_REFRESH_RECIPE_ID"); } }
  2. 2. There is a trigger WHEN-CUSTOM-ITEM-EVENT on Bean Area, for example:And trigger code: DESIGNER.Handle_Applet_Events;It’s a plsql procedure in this forms file, and it will handle events from java code, for example, corresponding code forabove event “CALL_REFRESH_RECIPE_ID”: ELSIF (:system.custom_item_event = CALL_REFRESH_RECIPE_ID) THEN ……… ELSEThis is all how forms communicates with custom applets.2, Designer Code AnalysisDesigner uses a C/S implementation, client side runs in browser’s java applet while server runs as a part of EBS’s tcfservice.2.1), Overall codeThere are three packages: oracle.apps.gmd.recipeDesigner.common  $GMD_TOP/ java/recipeDesigner/common oracle.apps.gmd.recipeDesigner.javaui  $GMD_TOP/ java/recipeDesigner/javaui oracle.apps.gmd.recipeDesigner.server  $GMD_TOP/ java/recipeDesigner/servercommon package, as it states, is shared by javaui/server packages.Note: code is shared by recipe/formula/routing designers.2.2), client code2.2.1), RecipeDesigner.javaactionPerformed This method is called when you operates in the designer. For example, when you click File -> save, acommand “SAVE” is passed to this method.setProperty When forms calls SET_CUSTOM_ITEM_PROPERTY, this method will be called. For example, if ((command.toUpperCase()).equals("OPEN_RECIPE")) { // we are opening the given recipe Constants.RECIPE_ID = Integer.valueOf(paramTokens.nextToken()). intValue(); m_isNewRecipe = false; refresh(false, true, true, true, true);
  3. 3. }2.2.2), MaterialDataManager/FormulaDataManagerThis class is used by RecipeDesigner to exchange data with data servers on server side, for example,MaterialDataServer.2.3), server code2.3.1), MaterialDataServerIt routes requests from client’s DataManager to server’s TreeServer. It uses Item.java as the medium of dataexchange. The data format is like: T01:V1:6,T00:V170:2460460................................2.3.2), MaterialTreeServerIt receives requests from DataServer, actually interacts with Database through JDBC API.Note: call sequenceRecipeDesigner -> MaterialDataManager(client) -> MaterialDataServer(server) -> MaterialTreeServer(server)2.3.3), PLSQL packagesGMD_RECIPE_DESIGNER_PKG3, Debugging3.1, Client debugClient debug focuses on RecipeDesigner.java, imply use System.out.println to do client debug, or use below methodto print call information. private void printCall(String mtd, String[] na, String[] va) { StringBuffer buf = new StringBuffer("Method: " + mtd +"t Params: "); for(int i = 0; i < na.length; i++) { buf.append(na[i]).append("=").append(va[i]).append(";"); } System.out.println(buf.toString()); }or use the following not-so-elegant code to get call trace: try { throw new Exception("for call trace"); } catch(Exception ex) { ex.printStackTrace(System.out); }3.2, Server debugFor server debug, you can choose to write debug info in log files or database. I prefer the files choice. By addingdebug methods to CommonDataServer/CommonTreeServer, you can call them in their implementations. This is anexample for debug method:
  4. 4. private String file="/home/applmgr/rcpdsg.log"; protected void log(String msg, boolean trace) { PrintWriter out = null; try { out = new PrintWriter(new OutputStreamWriter(new FileOutputStream(file,true))); // append if(trace) { try { throw new Exception("for call trace"); } catch(Exception ex) { ex.printStackTrace(out); } } out.println(msg); }catch(Exception ex) { }finally if(out !=null) { try { out.close(); } catch(Exception ex) {} } } }Make sure that you have write permission on the file you specify.4, Setup4.1), jdev setupIn dev desktop, use the following path:For 121 branch, select 1213x5dbg
  5. 5. Note: you have to choose corresponding jdev version for your code version, or there will be some unexpected errors.Or setup a jdev env on your testing box:1), download patch p9879989_R12_GENERIC.zip, and unzip2), under your home folder, edit .jdev_jdk, input jdk5’s path, for example: /usr/java/jdk1.5.0_223), start jdev4.2), project setupFirst copy code from arcs, take branch121 as an example, chenv gmd GMD121 gmddev cp -R $gmd/java/recipeDesigner/common $yourfolder cp -R $gmd/java/recipeDesigner/server $yourfolder cp -R $gmd/java/recipeDesigner/javaui $yourfoldercopy following fnd jars from your EBS instance: fndaol.jar fndctx.jar fndforms.jar fndjewtall.jar fndsec.jar fndaolj.jar fndewt.jar fndgantt.jar fndjewt.jar fndtcf.jar fndbalishare.jar fndewtpv.jar fndhier.jar fndjle.jarIn jdev, create a user library to include all these jars, take my example as fnd-ext.Set project libraries like:4.3), deployFirst, create a new jar deploy profile, File -> New,
  6. 6. Deploy,Should be fine like,5, TestingServer sidereplace class file under $OA_JAVA/oracle/apps/gmd/recipeDesigner/server/, restart applications;Client sidereplace jar file under $OA_JAVA/oracle/apps/gmd/jar, clear all browser java cache(through java control panel ->settings -> delete all files), better restart browser;--EOF--