for(Template template: doc.getTemplates()){
if(template.isAppropriate(doc)){
try {
doc.addItemInstances(template,template.process(doc));
} catch (TerminologyException e) {
throw new TerminologyError("Unforseen issue",e);
}
}
}
processTime = System.currentTimeMillis() -processTime;
totalTime += processTime;