if (hpiList.isEmpty()) {
out.println("No History on Activiti Processes.");
return;
}
TextTable txtTable = new TextTable(4);
txtTable.addHeaders("Definition ID", "Instance ID", "Start Time", "End Time");
for (HistoricProcessInstance hpi : hpiList) {
Date endTime = hpi.getEndTime();
if (endTime == null && !printActive) {
continue; // don't print active instance history if printActive is false - default.
}
txtTable.addRow(hpi.getProcessDefinitionId(), hpi.getId(),
formatDate(hpi.getStartTime()), formatDate(hpi.getEndTime()));
}
txtTable.print(out);
}