@Override
protected void writeContents() throws IOException {
// First, look at the project which is invoking this script, and see
// if it is preceded by a PSP0 program. If not, print nothing and exit.
DataContext data = getDataContext();
SimpleData prevProgramVal = data.getSimpleValue("Previous_Program");
if (!hasValue(prevProgramVal))
return;
String prevProgram = prevProgramVal.format();
SimpleData psp0tag = data.getSimpleValue(prevProgram + "/PSP0");
if (!hasValue(psp0tag))
return;
// Next, check to see if size data has been entered for the preceding
// PSP0 program. If it has, print nothing and exit.
SimpleData psp0size = data.getSimpleValue(prevProgram
+ "/New & Changed LOC");
if (hasValue(psp0size))
return;
// At this point, we know this project is preceded by a PSP0 program
// that has no size data. However, we don't want to print any warnings
// during the Planning phase of this project, because that would
// confuse students unnecessarily. So we look for several signs
// indicating that they might be in or approaching the Postmortem
// phase of this project.
if (hasValue(data.getSimpleValue("Test/Time"))
|| hasValue(data.getSimpleValue("Postmortem/Time"))
|| hasValue(data.getSimpleValue("New & Changed LOC"))) {
printSizeWarningBlock(prevProgram);
}
}