Hi Everybody,

We are new bee to jess and are working hard to learn the tricks of jess.

We  are facing some problems in storing and fetching varibles between
java and jess.

We have a simple Knowledge base asserted by deffact :

rete.executeCommand("(deffacts Knowledgebase"+
      "(Knowledge knowledge1)"+
                    "(Knowledge not)"+
                    "(Knowledge working))" );
rete.reset();

.......


then we define some other facts, the attributes of which are derived
from fAtomArray[]

for(int i=0;i<tokenCount;i++)

  {

          rete.executeCommand("(defrule assert_problems" +
          " =>" +
         "  (assert (Problem "+ fAtomArray[i] +")))");
          rete.run();

  }



now we run a rule

rete.executeCommand(
                    "(defrule findderv" +
      "(Knowledge ?x)"+
      "(Problem ?x)"+
      "=>"+
      "(assert (derivedattrib ?x))"+
      "(printout t  ?x crlf))"
    );
rete.run();

as a result of firing this rule certain facts would be asserted like

derivedattrib not
derivedattrib working
...........

we want to retrive these facts in java. Can you suggest some method for
doing
so. If we use a store and fetch command in the rule findderv only one
value can be stored. Can you suggest the code to use value vector in
java as a solution to this problem.


the code for the java file (ug5.java) is attached. Enter the text
"Printer not working properly" into the free form text of the frame that
appears.

thus the two facts asserted on firing of findderv defrule would be

derivedattrib not
derivedattrib working

we want to get the string "not" and "working" in java.

ug5.java

Reply via email to