Not only the Activity Window, but also the statistical overview and reports can be read.
Reading Statistical Records
The class "GenericStatistics" provides access to the statistical overview. Use the various filter settings to specify the statistical records to be requested. The result can then be checked with an iterator via the class "StatisticSearchItem".
GenericStatistics statistic = new GenericStatistics();
statistic.setObjectName("MM.CLOSING");
statistic.setTypeJOBS(true);
uc4.sendRequestAndWait(statistic);
if(statistic.size() > 0)
{
Iterator it = statistic.resultIterator();
while(it.hasNext())
{
StatisticSearchItem result = (StatisticSearchItem) it.next();
System.out.println("Result: " + result.getParentRunNumber());
System.out.println("Result: " + result.getReturnCode());
System.out.println("Result: " + result.getStatusText());
}
}
Reading Reports
The class "ReportBericht, der nähere Informationen über die Durchführung einer Aufgabe oder einer Komponente enthält." and the RunID"Kurzform für ""laufende Nummer"". Hierbei handelt es sich genauer um eine Zahl, welche die Durchführung einer Aufgabe eindeutig kennzeichnet. Die RunID kann zwischen 7 und 10 Stellen aufweisen. Sie wird von der Komponente Automation Engine vergeben." of the execution are required for reading reports. The RunID is retrieved using the class "LatestReport" which supplies the particular report pages in the form of a string. Keep in mind that a request must be sent for each individual page.
int i = 1;
UC4ObjectName name = new UC4ObjectName("MM.CLOSING");
LatestReport runnumber = new LatestReport(name);
uc4.sendRequestAndWait(runnumber);
Report report = new Report(runnumber.latestRunNumber(), "REP");
uc4.sendRequestAndWait(report);
while(i <= report.getNumberOfPages())
{
String page;
System.out.println("current page: " + report.getCurrentPage());
page = report.getReport();
if( (page.indexOf("cd Temp")) != -1)
{
System.out.println("found");
}
report.nextPage(i);
uc4.sendRequestAndWait(report);
i++;
}
See also:
Classes for Objects
Classes for Workflows and Schedules
Classes for Activities
Classes for the System Overview