Implementing the Diagnostic PeopleCode

To implement the diagnostic PeopleCode:

  1. Open the PeopleCode editor (View, and then PeopleCode).

  2. Import the PTDiagnostic package, by entering:

    import PT_DIAGNOSTICS:*;
  3. This imports all the classes in the PT_DIAGNOSTICS application package.

  4. Define the class, using the same procedure as your would for any PeopleCode program. For example,

    class <class name> extends PTDiagnostic:PTDiagnostic

    This 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.

  5. 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 %Super resides in the PTDiagnostics application class.

    If you want to display the rowset in the browser, then you have to set the hasRowset property 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 Where property to true, otherwise make it False. For example,

    &status = %Super.SetProperty (%This, "Where", "Boolean", True);

    Method GetDiagnosticInfo

    This 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 IsPlugIn

    The 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;