*/
// a list of DataTables is expected as return Object, even if there is
// only one
// Data Table as it is here in this implementation
DataTable tableStepOpenAndDone = getAllSteps(HistoryEventType.stepOpen);
tableStepOpenAndDone.setUnitLabel(Helper.getTranslation(this.timeGrouping.getSingularTitle()));
tableStepOpenAndDone.setName(StatisticsMode.getByClassName(this.getClass()).getTitle() + " (" + Helper.getTranslation("openSteps") + ")");
tableStepOpenAndDone = tableStepOpenAndDone.getDataTableInverted();
tableStepOpenAndDone = tableStepOpenAndDone.getDataTableInverted();
tableStepOpenAndDone.setShowableInChart(false);
allTables.add(tableStepOpenAndDone);
tableStepOpenAndDone = getAllSteps(HistoryEventType.stepDone);
tableStepOpenAndDone.setUnitLabel(Helper.getTranslation(this.timeGrouping.getSingularTitle()));
tableStepOpenAndDone.setName(StatisticsMode.getByClassName(this.getClass()).getTitle() + " (" + Helper.getTranslation("doneSteps") + ")");
tableStepOpenAndDone.setShowableInChart(false);
tableStepOpenAndDone = tableStepOpenAndDone.getDataTableInverted();
tableStepOpenAndDone = tableStepOpenAndDone.getDataTableInverted();
allTables.add(tableStepOpenAndDone);
/*
* ======================================================================
* ==============
*/
// what do we do here?
// okay ... first we find out how many steps the selected set has
// finding lowest step and highest step (no step name discrimination)
Integer uBound;
Integer uBoundOpen = getMaxStepCount(HistoryEventType.stepOpen);
Integer uBoundDone = getMaxStepCount(HistoryEventType.stepDone);
if (uBoundOpen < uBoundDone) {
uBound = uBoundDone;
} else {
uBound = uBoundOpen;
}
Integer lBound;
Integer lBoundOpen = getMinStepCount(HistoryEventType.stepOpen);
Integer lBoundDone = getMinStepCount(HistoryEventType.stepDone);
if (lBoundOpen < lBoundDone) {
lBound = lBoundDone;
} else {
lBound = lBoundOpen;
}
// then for each step we get both the open and the done count within the
// selected intervalls and merge it within one table
for (Integer i = lBound; i <= uBound; i++) {
DataTable tableStepOpen;
tableStepOpen = getSpecificSteps(i, HistoryEventType.stepOpen);
tableStepOpen.setShowableInTable(true);
DataTable tableStepDone;
tableStepDone = getSpecificSteps(i, HistoryEventType.stepDone);
tableStepDone.setShowableInTable(true);
// to merge we just take each table and dump the entire content in a
// row for the open step
DataRow rowOpenSteps = new DataRow(Helper.getTranslation("openSteps") + " " + i.toString());
for (DataRow dtr : tableStepOpen.getDataRows()) {
rowOpenSteps.addValue(dtr.getName(), dtr.getValue(0));
}
// adding the first row
String title = "";
if (tableStepOpen.getName().length() > 0) {
title = tableStepOpen.getName();
} else {
title = tableStepDone.getName();
}
tableStepOpenAndDone = new DataTable(Helper.getTranslation("throughput") + " " + Helper.getTranslation("steps") + " " + title);
tableStepOpenAndDone.addDataRow(rowOpenSteps);
// row for the done step
rowOpenSteps = new DataRow(Helper.getTranslation("doneSteps") + " " + i.toString());
for (DataRow dtr : tableStepDone.getDataRows()) {
rowOpenSteps.addValue(dtr.getName(), dtr.getValue(0));
}
// adding that row
tableStepOpenAndDone.addDataRow(rowOpenSteps);