posted 9 years ago
hello es anyone of you knows how to get the result generated by jess and put on a WRITER or view directly on a textArea
I tried too much stuff and it did not work (I'm stuck)
Writer os = new StringWriter();
engine.addOutputRouter("t",os);
System.out.println(os.toString());
os rest empty
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
Rete engine = new Rete();
try {
engine.batch(nom);
engine.executeCommand("(reset)");
engine.executeCommand("(assert (fait mo ))");
Writer os = new StringWriter();
engine.addOutputRouter("t",os);
System.out.println(os.toString());
engine.executeCommand("run");
}
catch (JessException je) {
System.out.println("2:" + je.getMessage());
}