Classes for Statistics and Reports

Not only the Process Monitoring, but also the statistical overview and reports can be read.

This page includes the following:

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 Report and the RunID 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:

Object Classes
Classes for Workflows and Schedules Classes for Activities
Classes for the Administration Perspective