*/
@SuppressWarnings({ "deprecation" })
public void compile(int NumErrorsToReport, PrintStream err) {
try {
IRSession session = new RSession(ruleSet);
Class<ICompiler> compilerClass = ruleSet.getDefaultCompiler();
if(compilerClass == null){
throw new RulesException("undefined", "Excel2XML", "No default compiler has been found." +
" We cannot convert and compile the XML without one");
}
ICompiler defaultCompiler = (ICompiler) compilerClass.newInstance();
defaultCompiler.setSession(session);
ICompiler compiler = defaultCompiler;
dtcompiler = new DTCompiler(compiler);
InputStream inDTStream = new FileInputStream(ruleSet.getFilepath()+"/"+UDTFilename);
OutputStream outDTStream = new FileOutputStream(ruleSet.getFilepath()+"/"+ruleSet.getDT_XMLName());
dtcompiler.compile(inDTStream, outDTStream);
RulesDirectory rd = new RulesDirectory(path, rulesDirectoryXML);
RuleSet rs = rd.getRuleSet(RName.getRName(ruleset));
EntityFactory ef = rs.newSession().getEntityFactory();
IREntity dt = ef.getDecisiontables();
Iterator<RName> idt = ef.getDecisionTableRNameIterator();
while(idt.hasNext()){
RDecisionTable t = (RDecisionTable) dt.get(idt.next());
t.build(session.getState());
List<IDecisionTableError> errs = t.compile();
for (IDecisionTableError error : errs){
dtcompiler.logError(
t.getName().stringValue(),
t.getFilename(),