hello, im sorry for disturbing again. i want to ask question again.
i have a problem. i make an aplication that use java netbeans and jess.
the aplication is about consultation,
so i must make interface that can input from user action. the problem is,
i want to go to previous question.
how can i do that?
in my program, i make 'back' button, this is the source code :
private void kembaliActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
try {
_rEngine.back();
}
catch (Exception xcp) {
return;
}
}
and then in jessEngine, still in java i use code like this :
public void back()
{
try {
rete.executeCommand("(reset)");
rete.executeCommand("(assert(kembali jawaban-back))");
rete.executeCommand("(run)");
rete.eval("(facts)");
}
catch (JessException je) {
je.getMessage();
}
}
when i click on that button, program stop running, not stop actually, it
looks like never ending loading. i used same rete with rete that batch the
.clp, reset, and run.
Rete rete = new Rete();
and when i make new Rete (Rete r = new Rete), fact can asserted on working
memory. but it didnt activated.
public void back()
{
Rete r = new Rete();
try {
r.executeCommand("(reset)");
r.executeCommand("(assert(kembali jawaban-back))");
r.executeCommand("(run)");
r.eval("(facts)");
}
catch (JessException je) {
je.getMessage();
}
}
and it looks like this :
.............................................................
==> f-19 (MAIN::warisan (cari hak-arrad) (type arrad) (nama ayah) (persen
0.16666666666666666) (pembilang 1) (penyebut 6) (idnya 36))
FIRE 13 MAIN::identifikasi-anak-laki f-1
:::::: after i click back button :::::::::::::::::::::
f-0 (MAIN::initial-fact) >>>>>>>>>>
f-1 (MAIN::kembali jawaban-back) >>>>>>>>>> fact inserted but
didn’t activated
For a total of 2 facts in module MAIN. >>>>>>>>>>
::::::::::::: after i click next button it continue running::::::::
==> f-20 (MAIN::identifikasi (cari jawaban) (ahli-waris anak-laki) (type
anak-laki) (jawab "ya"))
==> Activation: MAIN::identifikasi-jumlah-anak-laki : f-20
....................................................................
BUILD SUCCESSFUL (total time: 18 seconds)
so when it didnt activated, it doesnt fired the rule that matched, and
continue to running.
In my imagination that if fact is activated, it can fire this rule :
(defrule back-jawaban
(kembali jawaban-back)
=>
(bind ?jawab (run-query* cari-jawaban jawaban))
(bind ?ahli-waris (?jawab getString b))
(assert (identifikasi-ulang ?ahli-waris))
)
And then can fire this to (if the last query is ‘dad’ so
?ahli-waris = ‘dad’) :
(defrule identifikasi-ayah-back
(identifikasi-ulang dad)
=>
(printout t "have dad ?")
(bind ?jawab (readline))
(modify ?f (jawab ?jawab))
(assert (insert-jawaban jawaban dad ?jawab))
)
so, what should i do? how can i assert fact with different rete but it can
read in another rete? Or i can use another way?
thanks.
regards,
vivi
--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------