}
public void printReport(int runNumber, IRSession session, PrintStream _out) throws RulesException {
XMLPrinter xout = new XMLPrinter(_out);
xout.opentag("results","runNumber",runNumber);
RArray results = session.getState().find("job.results").rArrayValue();
for(IRObject r :results){
IREntity result = r.rEntityValue();
xout.opentag("Client","id",result.get("client_id").stringValue());
prt(xout,result,"totalGroupIncome");
prt(xout,result,"client_fpl");
if(result.get("eligible").booleanValue()){
xout.opentag("Approved");
prt(xout,result,"program");
prt(xout,result,"programLevel");
RArray notes = result.get("notes").rArrayValue();
xout.opentag("Notes");
for(IRObject n : notes){
xout.printdata("note",n.stringValue());
}
xout.closetag();
xout.closetag();
}else{
xout.opentag("NotApproved");
prt(xout,result,"program");
RArray notes = result.get("notes").rArrayValue();
xout.opentag("Notes");
for(IRObject n : notes){
xout.printdata("note",n.stringValue());
}
xout.closetag();