SlideShare una empresa de Scribd logo
1 de 6
GMD Designer --for Recipe/Formula/Routing
1, Forms and Designer Communication
2, Designer Code Analysis
3, Debugging
4, Setup
5, Testing


1, Forms and Designer Communication
1.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.fmb




Use 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 Forms
Designer 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");
                }
        }
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 for
above event “CALL_REFRESH_RECIPE_ID”:
                 ELSIF (:system.custom_item_event = 'CALL_REFRESH_RECIPE_ID') THEN
                        ………
                 ELSE

This is all how forms communicates with custom applets.


2, Designer Code Analysis
Designer uses a C/S implementation, client side runs in browser’s java applet while server runs as a part of EBS’s tcf
service.

2.1), Overall code
There 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/server

common package, as it states, is shared by javaui/server packages.

Note: code is shared by recipe/formula/routing designers.

2.2), client code

2.2.1), RecipeDesigner.java

actionPerformed
       This method is called when you operates in the designer. For example, when you click File -> save, a
command “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);
}

2.2.2), MaterialDataManager/FormulaDataManager

This class is used by RecipeDesigner to exchange data with data servers on server side, for example,
MaterialDataServer.


2.3), server code

2.3.1), MaterialDataServer
It routes requests from client’s DataManager to server’s TreeServer. It uses Item.java as the medium of data
exchange. The data format is like:
                       T01:V1:6,T00:V170:2460460................................

2.3.2), MaterialTreeServer
It receives requests from DataServer, actually interacts with Database through JDBC API.

Note: call sequence
RecipeDesigner -> MaterialDataManager(client) -> MaterialDataServer(server) -> MaterialTreeServer(server)

2.3.3), PLSQL packages
GMD_RECIPE_DESIGNER_PKG

3, Debugging
3.1, Client debug
Client debug focuses on RecipeDesigner.java, imply use System.out.println to do client debug, or use below method
to 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 debug
For server debug, you can choose to write debug info in log files or database. I prefer the files choice. By adding
debug methods to CommonDataServer/CommonTreeServer, you can call them in their implementations. This is an
example for debug method:
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, Setup
4.1), jdev setup
In dev desktop, use the following path:




For 121 branch, select 1213x5dbg
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 unzip
2), under your home folder, edit .jdev_jdk, input jdk5’s path, for example: /usr/java/jdk1.5.0_22
3), start jdev

4.2), project setup
First 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 $yourfolder

copy 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.jar

In jdev, create a user library to include all these jars, take my example as fnd-ext.




Set project libraries like:




4.3), deploy
First, create a new jar deploy profile, File -> New,
Deploy,




Should be fine like,




5, Testing
Server side
replace class file under $OA_JAVA/oracle/apps/gmd/recipeDesigner/server/, restart applications;

Client side
replace 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--

Más contenido relacionado

La actualidad más candente

Unit Testing using PHPUnit
Unit Testing using  PHPUnitUnit Testing using  PHPUnit
Unit Testing using PHPUnitvaruntaliyan
 
PhpUnit Best Practices
PhpUnit Best PracticesPhpUnit Best Practices
PhpUnit Best PracticesEdorian
 
PHPUnit best practices presentation
PHPUnit best practices presentationPHPUnit best practices presentation
PHPUnit best practices presentationThanh Robi
 
Test your code like a pro - PHPUnit in practice
Test your code like a pro - PHPUnit in practiceTest your code like a pro - PHPUnit in practice
Test your code like a pro - PHPUnit in practiceSebastian Marek
 
Oracle 11g new features for developers
Oracle 11g new features for developersOracle 11g new features for developers
Oracle 11g new features for developersScott Wesley
 
Software Testing - Invited Lecture at UNSW Sydney
Software Testing - Invited Lecture at UNSW SydneySoftware Testing - Invited Lecture at UNSW Sydney
Software Testing - Invited Lecture at UNSW Sydneyjulien.ponge
 
javascript function & closure
javascript function & closurejavascript function & closure
javascript function & closureHika Maeng
 
The Ring programming language version 1.7 book - Part 84 of 196
The Ring programming language version 1.7 book - Part 84 of 196The Ring programming language version 1.7 book - Part 84 of 196
The Ring programming language version 1.7 book - Part 84 of 196Mahmoud Samir Fayed
 
Java 7 Launch Event at LyonJUG, Lyon France. Fork / Join framework and Projec...
Java 7 Launch Event at LyonJUG, Lyon France. Fork / Join framework and Projec...Java 7 Launch Event at LyonJUG, Lyon France. Fork / Join framework and Projec...
Java 7 Launch Event at LyonJUG, Lyon France. Fork / Join framework and Projec...julien.ponge
 
The Ring programming language version 1.10 book - Part 17 of 212
The Ring programming language version 1.10 book - Part 17 of 212The Ring programming language version 1.10 book - Part 17 of 212
The Ring programming language version 1.10 book - Part 17 of 212Mahmoud Samir Fayed
 
201913001 khairunnisa progres_harian
201913001 khairunnisa progres_harian201913001 khairunnisa progres_harian
201913001 khairunnisa progres_harianKhairunnisaPekanbaru
 
Java script advance-auroskills (2)
Java script advance-auroskills (2)Java script advance-auroskills (2)
Java script advance-auroskills (2)BoneyGawande
 
Efficient JavaScript Mutation Testing
Efficient JavaScript Mutation TestingEfficient JavaScript Mutation Testing
Efficient JavaScript Mutation TestingSALT Lab @ UBC
 
Unit testing with PHPUnit
Unit testing with PHPUnitUnit testing with PHPUnit
Unit testing with PHPUnitferca_sl
 

La actualidad más candente (20)

Unit Testing using PHPUnit
Unit Testing using  PHPUnitUnit Testing using  PHPUnit
Unit Testing using PHPUnit
 
PhpUnit Best Practices
PhpUnit Best PracticesPhpUnit Best Practices
PhpUnit Best Practices
 
Django
Django Django
Django
 
GMock framework
GMock frameworkGMock framework
GMock framework
 
PHPUnit best practices presentation
PHPUnit best practices presentationPHPUnit best practices presentation
PHPUnit best practices presentation
 
Test your code like a pro - PHPUnit in practice
Test your code like a pro - PHPUnit in practiceTest your code like a pro - PHPUnit in practice
Test your code like a pro - PHPUnit in practice
 
Oracle 11g new features for developers
Oracle 11g new features for developersOracle 11g new features for developers
Oracle 11g new features for developers
 
Software Testing - Invited Lecture at UNSW Sydney
Software Testing - Invited Lecture at UNSW SydneySoftware Testing - Invited Lecture at UNSW Sydney
Software Testing - Invited Lecture at UNSW Sydney
 
javascript function & closure
javascript function & closurejavascript function & closure
javascript function & closure
 
The Ring programming language version 1.7 book - Part 84 of 196
The Ring programming language version 1.7 book - Part 84 of 196The Ring programming language version 1.7 book - Part 84 of 196
The Ring programming language version 1.7 book - Part 84 of 196
 
Java 7 Launch Event at LyonJUG, Lyon France. Fork / Join framework and Projec...
Java 7 Launch Event at LyonJUG, Lyon France. Fork / Join framework and Projec...Java 7 Launch Event at LyonJUG, Lyon France. Fork / Join framework and Projec...
Java 7 Launch Event at LyonJUG, Lyon France. Fork / Join framework and Projec...
 
Java 7 LavaJUG
Java 7 LavaJUGJava 7 LavaJUG
Java 7 LavaJUG
 
The Ring programming language version 1.10 book - Part 17 of 212
The Ring programming language version 1.10 book - Part 17 of 212The Ring programming language version 1.10 book - Part 17 of 212
The Ring programming language version 1.10 book - Part 17 of 212
 
Fia fabila
Fia fabilaFia fabila
Fia fabila
 
201913001 khairunnisa progres_harian
201913001 khairunnisa progres_harian201913001 khairunnisa progres_harian
201913001 khairunnisa progres_harian
 
Tugas 2
Tugas 2Tugas 2
Tugas 2
 
Java script advance-auroskills (2)
Java script advance-auroskills (2)Java script advance-auroskills (2)
Java script advance-auroskills (2)
 
Efficient JavaScript Mutation Testing
Efficient JavaScript Mutation TestingEfficient JavaScript Mutation Testing
Efficient JavaScript Mutation Testing
 
Drizzle plugins
Drizzle pluginsDrizzle plugins
Drizzle plugins
 
Unit testing with PHPUnit
Unit testing with PHPUnitUnit testing with PHPUnit
Unit testing with PHPUnit
 

Destacado

7, vnc server
7, vnc server7, vnc server
7, vnc serverted-xu
 
2, installation
2, installation2, installation
2, installationted-xu
 
Português – oraçõs subordinadas adjetivas 01 – 2014 – ifba
Português – oraçõs subordinadas adjetivas 01 – 2014 – ifbaPortuguês – oraçõs subordinadas adjetivas 01 – 2014 – ifba
Português – oraçõs subordinadas adjetivas 01 – 2014 – ifbaJakson Raphael Pereira Barbosa
 
What English Do University Students Really Need
What English Do University Students Really NeedWhat English Do University Students Really Need
What English Do University Students Really NeedHala Nur
 
3, users & groups
3, users & groups3, users & groups
3, users & groupsted-xu
 
Internet and Sudan
Internet and SudanInternet and Sudan
Internet and SudanHala Nur
 
Making the short story long: An approach to Meeting the Needs of Low Level U...
 Making the short story long: An approach to Meeting the Needs of Low Level U... Making the short story long: An approach to Meeting the Needs of Low Level U...
Making the short story long: An approach to Meeting the Needs of Low Level U...Hala Nur
 
English education: Recent Developments and current Issues
English education: Recent Developments and current IssuesEnglish education: Recent Developments and current Issues
English education: Recent Developments and current Issuesiescomarcalburjassot
 
Current International Developments in English Language Teaching (ELT) and Imp...
Current International Developments in English Language Teaching (ELT) and Imp...Current International Developments in English Language Teaching (ELT) and Imp...
Current International Developments in English Language Teaching (ELT) and Imp...Hala Nur
 
realizacion de llamadas y videollamadas
realizacion de llamadas y videollamadas realizacion de llamadas y videollamadas
realizacion de llamadas y videollamadas karenvela29
 
5кл. "Музика і кіно."
 5кл. "Музика і кіно." 5кл. "Музика і кіно."
5кл. "Музика і кіно."nataliyu roschina
 

Destacado (13)

Blog
BlogBlog
Blog
 
7, vnc server
7, vnc server7, vnc server
7, vnc server
 
2, installation
2, installation2, installation
2, installation
 
Português – oraçõs subordinadas adjetivas 01 – 2014 – ifba
Português – oraçõs subordinadas adjetivas 01 – 2014 – ifbaPortuguês – oraçõs subordinadas adjetivas 01 – 2014 – ifba
Português – oraçõs subordinadas adjetivas 01 – 2014 – ifba
 
What English Do University Students Really Need
What English Do University Students Really NeedWhat English Do University Students Really Need
What English Do University Students Really Need
 
3, users & groups
3, users & groups3, users & groups
3, users & groups
 
Internet and Sudan
Internet and SudanInternet and Sudan
Internet and Sudan
 
Making the short story long: An approach to Meeting the Needs of Low Level U...
 Making the short story long: An approach to Meeting the Needs of Low Level U... Making the short story long: An approach to Meeting the Needs of Low Level U...
Making the short story long: An approach to Meeting the Needs of Low Level U...
 
English education: Recent Developments and current Issues
English education: Recent Developments and current IssuesEnglish education: Recent Developments and current Issues
English education: Recent Developments and current Issues
 
Current International Developments in English Language Teaching (ELT) and Imp...
Current International Developments in English Language Teaching (ELT) and Imp...Current International Developments in English Language Teaching (ELT) and Imp...
Current International Developments in English Language Teaching (ELT) and Imp...
 
Sifilis terminado
Sifilis terminadoSifilis terminado
Sifilis terminado
 
realizacion de llamadas y videollamadas
realizacion de llamadas y videollamadas realizacion de llamadas y videollamadas
realizacion de llamadas y videollamadas
 
5кл. "Музика і кіно."
 5кл. "Музика і кіно." 5кл. "Музика і кіно."
5кл. "Музика і кіно."
 

Similar a GMD Designer Code Analysis and Debugging Techniques

Xdebug - Derick Rethans - Barcelona PHP Conference 2008
Xdebug - Derick Rethans - Barcelona PHP Conference 2008Xdebug - Derick Rethans - Barcelona PHP Conference 2008
Xdebug - Derick Rethans - Barcelona PHP Conference 2008phpbarcelona
 
Django - Know Your Namespace: Middleware
Django - Know Your Namespace: MiddlewareDjango - Know Your Namespace: Middleware
Django - Know Your Namespace: Middlewarehowiworkdaily
 
Тестирование и Django
Тестирование и DjangoТестирование и Django
Тестирование и DjangoMoscowDjango
 
TypeScript for Java Developers
TypeScript for Java DevelopersTypeScript for Java Developers
TypeScript for Java DevelopersYakov Fain
 
Background Jobs - Com BackgrounDRb
Background Jobs - Com BackgrounDRbBackground Jobs - Com BackgrounDRb
Background Jobs - Com BackgrounDRbJuan Maiz
 
Exercícios Netbeans - Vera Cymbron
Exercícios Netbeans - Vera CymbronExercícios Netbeans - Vera Cymbron
Exercícios Netbeans - Vera Cymbroncymbron
 
Building Testable PHP Applications
Building Testable PHP ApplicationsBuilding Testable PHP Applications
Building Testable PHP Applicationschartjes
 
MT_01_unittest_python.pdf
MT_01_unittest_python.pdfMT_01_unittest_python.pdf
MT_01_unittest_python.pdfHans Jones
 
ProGuard / DexGuard Tips and Tricks
ProGuard / DexGuard Tips and TricksProGuard / DexGuard Tips and Tricks
ProGuard / DexGuard Tips and Tricksnetomi
 
Дмитрий Демчук. Кроссплатформенный краш-репорт
Дмитрий Демчук. Кроссплатформенный краш-репортДмитрий Демчук. Кроссплатформенный краш-репорт
Дмитрий Демчук. Кроссплатформенный краш-репортSergey Platonov
 
CommissionCalculationbuildclasses.netbeans_automatic_build.docx
CommissionCalculationbuildclasses.netbeans_automatic_build.docxCommissionCalculationbuildclasses.netbeans_automatic_build.docx
CommissionCalculationbuildclasses.netbeans_automatic_build.docxmonicafrancis71118
 
Innovative Specifications for Better Performance Logging and Monitoring
Innovative Specifications for Better Performance Logging and MonitoringInnovative Specifications for Better Performance Logging and Monitoring
Innovative Specifications for Better Performance Logging and MonitoringCary Millsap
 
Implementações paralelas
Implementações paralelasImplementações paralelas
Implementações paralelasWillian Molinari
 
How to make a high-quality Node.js app, Nikita Galkin
How to make a high-quality Node.js app, Nikita GalkinHow to make a high-quality Node.js app, Nikita Galkin
How to make a high-quality Node.js app, Nikita GalkinSigma Software
 

Similar a GMD Designer Code Analysis and Debugging Techniques (20)

Xdebug - Derick Rethans - Barcelona PHP Conference 2008
Xdebug - Derick Rethans - Barcelona PHP Conference 2008Xdebug - Derick Rethans - Barcelona PHP Conference 2008
Xdebug - Derick Rethans - Barcelona PHP Conference 2008
 
Django - Know Your Namespace: Middleware
Django - Know Your Namespace: MiddlewareDjango - Know Your Namespace: Middleware
Django - Know Your Namespace: Middleware
 
Proguard android
Proguard androidProguard android
Proguard android
 
Тестирование и Django
Тестирование и DjangoТестирование и Django
Тестирование и Django
 
Lesson 2
Lesson 2Lesson 2
Lesson 2
 
TypeScript for Java Developers
TypeScript for Java DevelopersTypeScript for Java Developers
TypeScript for Java Developers
 
Background Jobs - Com BackgrounDRb
Background Jobs - Com BackgrounDRbBackground Jobs - Com BackgrounDRb
Background Jobs - Com BackgrounDRb
 
Exercícios Netbeans - Vera Cymbron
Exercícios Netbeans - Vera CymbronExercícios Netbeans - Vera Cymbron
Exercícios Netbeans - Vera Cymbron
 
Building Testable PHP Applications
Building Testable PHP ApplicationsBuilding Testable PHP Applications
Building Testable PHP Applications
 
Benchmarking on JVM
Benchmarking on JVMBenchmarking on JVM
Benchmarking on JVM
 
MT_01_unittest_python.pdf
MT_01_unittest_python.pdfMT_01_unittest_python.pdf
MT_01_unittest_python.pdf
 
Amazon elastic map reduce
Amazon elastic map reduceAmazon elastic map reduce
Amazon elastic map reduce
 
ProGuard / DexGuard Tips and Tricks
ProGuard / DexGuard Tips and TricksProGuard / DexGuard Tips and Tricks
ProGuard / DexGuard Tips and Tricks
 
Dspace
DspaceDspace
Dspace
 
Дмитрий Демчук. Кроссплатформенный краш-репорт
Дмитрий Демчук. Кроссплатформенный краш-репортДмитрий Демчук. Кроссплатформенный краш-репорт
Дмитрий Демчук. Кроссплатформенный краш-репорт
 
Oracle applications 11i dba faq
Oracle applications 11i dba faqOracle applications 11i dba faq
Oracle applications 11i dba faq
 
CommissionCalculationbuildclasses.netbeans_automatic_build.docx
CommissionCalculationbuildclasses.netbeans_automatic_build.docxCommissionCalculationbuildclasses.netbeans_automatic_build.docx
CommissionCalculationbuildclasses.netbeans_automatic_build.docx
 
Innovative Specifications for Better Performance Logging and Monitoring
Innovative Specifications for Better Performance Logging and MonitoringInnovative Specifications for Better Performance Logging and Monitoring
Innovative Specifications for Better Performance Logging and Monitoring
 
Implementações paralelas
Implementações paralelasImplementações paralelas
Implementações paralelas
 
How to make a high-quality Node.js app, Nikita Galkin
How to make a high-quality Node.js app, Nikita GalkinHow to make a high-quality Node.js app, Nikita Galkin
How to make a high-quality Node.js app, Nikita Galkin
 

Más de ted-xu

11, OCP - awr & alert system
11, OCP - awr & alert system11, OCP - awr & alert system
11, OCP - awr & alert systemted-xu
 
10, OCP - flashback
10, OCP - flashback10, OCP - flashback
10, OCP - flashbackted-xu
 
9, OCP - restore and recovery with rman
9, OCP - restore and recovery with rman9, OCP - restore and recovery with rman
9, OCP - restore and recovery with rmanted-xu
 
8, OCP - backup with rman
8, OCP - backup with rman8, OCP - backup with rman
8, OCP - backup with rmanted-xu
 
7, OCP - configure database for backup and recovery
7, OCP - configure database for backup and recovery7, OCP - configure database for backup and recovery
7, OCP - configure database for backup and recoveryted-xu
 
6, OCP - oracle security
6, OCP - oracle security6, OCP - oracle security
6, OCP - oracle securityted-xu
 
5, OCP - oracle storage
5, OCP - oracle storage5, OCP - oracle storage
5, OCP - oracle storageted-xu
 
4, OCP - oracle networking
4, OCP - oracle networking4, OCP - oracle networking
4, OCP - oracle networkingted-xu
 
3, OCP - instance management
3, OCP - instance management3, OCP - instance management
3, OCP - instance managementted-xu
 
2, OCP - installing and creating a database
2, OCP - installing and creating a database2, OCP - installing and creating a database
2, OCP - installing and creating a databaseted-xu
 
1, OCP - architecture intro
1, OCP - architecture intro1, OCP - architecture intro
1, OCP - architecture introted-xu
 
12, OCP - performance tuning
12, OCP - performance tuning12, OCP - performance tuning
12, OCP - performance tuningted-xu
 
7, business event system
7, business event system7, business event system
7, business event systemted-xu
 
6, workflow miscellaneous
6, workflow miscellaneous6, workflow miscellaneous
6, workflow miscellaneousted-xu
 
5, workflow function activity
5, workflow function activity5, workflow function activity
5, workflow function activityted-xu
 
4, workflow tables & api
4, workflow tables & api4, workflow tables & api
4, workflow tables & apited-xu
 
3, workflow in ebs
3, workflow in ebs3, workflow in ebs
3, workflow in ebsted-xu
 
2, a simple workflow
2, a simple workflow2, a simple workflow
2, a simple workflowted-xu
 
1, workflow intro
1, workflow intro1, workflow intro
1, workflow introted-xu
 
8, bes tables & api
8, bes tables & api8, bes tables & api
8, bes tables & apited-xu
 

Más de ted-xu (20)

11, OCP - awr & alert system
11, OCP - awr & alert system11, OCP - awr & alert system
11, OCP - awr & alert system
 
10, OCP - flashback
10, OCP - flashback10, OCP - flashback
10, OCP - flashback
 
9, OCP - restore and recovery with rman
9, OCP - restore and recovery with rman9, OCP - restore and recovery with rman
9, OCP - restore and recovery with rman
 
8, OCP - backup with rman
8, OCP - backup with rman8, OCP - backup with rman
8, OCP - backup with rman
 
7, OCP - configure database for backup and recovery
7, OCP - configure database for backup and recovery7, OCP - configure database for backup and recovery
7, OCP - configure database for backup and recovery
 
6, OCP - oracle security
6, OCP - oracle security6, OCP - oracle security
6, OCP - oracle security
 
5, OCP - oracle storage
5, OCP - oracle storage5, OCP - oracle storage
5, OCP - oracle storage
 
4, OCP - oracle networking
4, OCP - oracle networking4, OCP - oracle networking
4, OCP - oracle networking
 
3, OCP - instance management
3, OCP - instance management3, OCP - instance management
3, OCP - instance management
 
2, OCP - installing and creating a database
2, OCP - installing and creating a database2, OCP - installing and creating a database
2, OCP - installing and creating a database
 
1, OCP - architecture intro
1, OCP - architecture intro1, OCP - architecture intro
1, OCP - architecture intro
 
12, OCP - performance tuning
12, OCP - performance tuning12, OCP - performance tuning
12, OCP - performance tuning
 
7, business event system
7, business event system7, business event system
7, business event system
 
6, workflow miscellaneous
6, workflow miscellaneous6, workflow miscellaneous
6, workflow miscellaneous
 
5, workflow function activity
5, workflow function activity5, workflow function activity
5, workflow function activity
 
4, workflow tables & api
4, workflow tables & api4, workflow tables & api
4, workflow tables & api
 
3, workflow in ebs
3, workflow in ebs3, workflow in ebs
3, workflow in ebs
 
2, a simple workflow
2, a simple workflow2, a simple workflow
2, a simple workflow
 
1, workflow intro
1, workflow intro1, workflow intro
1, workflow intro
 
8, bes tables & api
8, bes tables & api8, bes tables & api
8, bes tables & api
 

GMD Designer Code Analysis and Debugging Techniques

  • 1. GMD Designer --for Recipe/Formula/Routing 1, Forms and Designer Communication 2, Designer Code Analysis 3, Debugging 4, Setup 5, Testing 1, Forms and Designer Communication 1.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.fmb Use 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 Forms Designer 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. 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 for above event “CALL_REFRESH_RECIPE_ID”: ELSIF (:system.custom_item_event = 'CALL_REFRESH_RECIPE_ID') THEN ……… ELSE This is all how forms communicates with custom applets. 2, Designer Code Analysis Designer uses a C/S implementation, client side runs in browser’s java applet while server runs as a part of EBS’s tcf service. 2.1), Overall code There 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/server common package, as it states, is shared by javaui/server packages. Note: code is shared by recipe/formula/routing designers. 2.2), client code 2.2.1), RecipeDesigner.java actionPerformed This method is called when you operates in the designer. For example, when you click File -> save, a command “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. } 2.2.2), MaterialDataManager/FormulaDataManager This class is used by RecipeDesigner to exchange data with data servers on server side, for example, MaterialDataServer. 2.3), server code 2.3.1), MaterialDataServer It routes requests from client’s DataManager to server’s TreeServer. It uses Item.java as the medium of data exchange. The data format is like: T01:V1:6,T00:V170:2460460................................ 2.3.2), MaterialTreeServer It receives requests from DataServer, actually interacts with Database through JDBC API. Note: call sequence RecipeDesigner -> MaterialDataManager(client) -> MaterialDataServer(server) -> MaterialTreeServer(server) 2.3.3), PLSQL packages GMD_RECIPE_DESIGNER_PKG 3, Debugging 3.1, Client debug Client debug focuses on RecipeDesigner.java, imply use System.out.println to do client debug, or use below method to 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 debug For server debug, you can choose to write debug info in log files or database. I prefer the files choice. By adding debug methods to CommonDataServer/CommonTreeServer, you can call them in their implementations. This is an example for debug method:
  • 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, Setup 4.1), jdev setup In dev desktop, use the following path: For 121 branch, select 1213x5dbg
  • 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 unzip 2), under your home folder, edit .jdev_jdk, input jdk5’s path, for example: /usr/java/jdk1.5.0_22 3), start jdev 4.2), project setup First 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 $yourfolder copy 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.jar In jdev, create a user library to include all these jars, take my example as fnd-ext. Set project libraries like: 4.3), deploy First, create a new jar deploy profile, File -> New,
  • 6. Deploy, Should be fine like, 5, Testing Server side replace class file under $OA_JAVA/oracle/apps/gmd/recipeDesigner/server/, restart applications; Client side replace 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--