GetDiagnosticInfo
Description
Use this required public method to define the code that retrieves diagnostic information and returns it to Diagnostics Framework for presentation to the user. This method is invoked by Diagnostics Framework to initiate information collection, then output the results.
The GetDiagnosticInfo method uses the base class InsertData method to pass the results of the diagnostic to Diagnostics Framework for presentation to the users, for example:
&status = %Super.InsertData("Number", "Number of Records: ", &rs1.RowCount);
InsertData can pass output data using the following data types:
-
String
-
Number
-
Date
-
Boolean
-
Rowset
Before you can pass rowset data as output, you must first use the base class SetProperty method to set the base class hasRowset property to True.
Considerations for GetDiagnosticInfo include:
-
You can pass only one data type in each diagnostic plug-in application class. To return multiple data types, define multiple application classes. Results that are passed to the framework are retained in memory.
-
If you're also defining the GetDynamicPrompt method to prompt users for additional information, use the base class GetUserInputByKey method to retrieve the user responses, for example:
&status = %Super.GetUserInputByKey("Recs", &sVal); -
For more readable output, use the base class SetProperty method to insert a description into the base class Purpose property, for example:
&status = %Super.SetProperty(%This, "Purpose", "String", "This is a diagnostic to determine your license code.");
Note:
You can also set the Purpose property in the constructor or in the GetDynamicPrompt method.
Example
Following is an example of GetDiagnosticInfo that passes rowset data as output:
method GetDiagnosticInfo
Local boolean &status;
Local number &rc1;
Local Rowset &rs1;
Local string &sError;
&rs1 = CreateRowset(Record.PSLANGUAGES);
&rc1 = &rs1.Fill();
&status = %Super.SetProperty(%This, "hasRowset", "Boolean", True);
&status = %Super.InsertData("Rowset", "LANGUAGES description, not used in
output", &rs1);
end-method;