Friday, March 20, 2009

BP - Normal, Heart Beat - Normal. Rx - Run (Diagnostic report) frequently


Diagnostic Framework part of Oracle AIA Foundation Pack provides tools that help in maintaining the system. Diagnostic Framework provides information like which BPEL processes, ESB, Schemas got customized, Which schemas got extended, what custom directories got created, integrity of the config files, whether BPEL-ESB communication is working, JMS is working, custom XPATHs are working as desired & more.

Adding Custom Diagnostic tests
Beauty of the framework is that it allows you to add your own custom diagnostic tests with ease. For instance, if we want to add DBCheck test to the AIA FP Diagnostic framework, all we need to do is

1) Create our own Java code by implementing IAIADiagnostics interface. Sample code should look like this

package oracle.apps.aia.core.diagnostics.tests;

import java.util.Date;
import java.util.HashMap;
import oracle.apps.aia.core.diagnostics.IAIADiagnostics;
import oracle.apps.aia.core.diagnostics.util.DiagnosticsUtil;
import oracle.apps.aia.core.diagnostics.util.GetPatchesApplied;
import java.sql.*;

public class DBCheck implements IAIADiagnostics{
public DBCheck() { }
public String[] run(HashMap params) {

String testResult[] = executeTest(params);
return testResult; }
public String[] runBatch(HashMap params) {

String testResult[] = executeTest(params);
return testResult; }
private String[] executeTest(HashMap params) {
[[Insert Code Here]]
String testResult[] = {result.toString(), error.toString(), resultflag};
return testResult;
}
}
2) Compile the class and place it under ORACLE_HOME\bpel\system\classes and the appropriate package folder (in this case oracle\apps\aia\core\diagnostics\tests)
3) Add the below entry to AIADiagnosticsConfig.XML under
AIA_HOME\diagnostics\config
oracle.apps.aia.core.diagnostics.tests.DBCheck
4) Create the batch script by making a copy of the existing batch files under
AIA_HOME\diagnostics\bin and making the following change
set TEST_NAME=DBCheck
5) Execute the batch script

Ramesh Chandra Revuru

No comments:

Post a Comment