Implementing the Diagnostic PeopleCode
To implement the diagnostic PeopleCode:
-
Open the PeopleCode editor ().
-
Import the PTDiagnostic package, by entering:
import PT_DIAGNOSTICS:*; -
This imports all the classes in the PT_DIAGNOSTICS application package.
-
Define the class, using the same procedure as your would for any PeopleCode program. For example,
class <class name> extends PTDiagnostic:PTDiagnosticThis makes the class a diagnostic application class.
The class name mentioned in the PeopleCode should be the same as the class name which is under the application package.
All the classes defined in the diagnostic plug-in application package should be extended from the class PTDiagnostic:PTDiagnostic.
-
Define the following mandatory methods:
Method Description Method <class name>This is the constructor of the class.
Inside the method it is mandatory to have
%Super = create PT_DIAGNOSTICS:PTDiagnostics().More description of
%Superresides in the PTDiagnostics application class.If you want to display the rowset in the browser, then you have to set the
hasRowsetproperty to True, otherwise make it False. For example,&status = %Super.SetProperty (%This, "hasRowset", "Boolean", False);If you want to call additional information from the user during the execution and use it as the search criteria, then set the
Whereproperty to true, otherwise make it False. For example,&status = %Super.SetProperty (%This, "Where", "Boolean", True);Method GetDiagnosticInfoThis is the method that gets called when you launch the diagnostic plug-in.
To display any output in the browser you have to call
%Super.Insertdata(Data type, <String to name the display>, <variable name>).Method IsPlugInThe purpose of this method is to identify the application package as a diagnostic plug-in. If this method is not present, then the system does not recognize it as a diagnostic plug-in during the registration process.
This method should appear at the end of the diagnostic application class, and it should be an empty method.
The definition of this should be :
Method IsPlugIn end-method;