Hello. I have some problems with Jess Facts. I developed a small
Ontologie in Protege. With the function mapclass I connect these with
Jess. So far so well, now I want to send each Fact to Java. I have
e.g. 10 Facts, and I would like to send these to Java. Is there a
possibility facts in one while loop successively to send.
I have made an example with one fact and implemented one Userfunction
in Java. With this I call a (send ?m) in Jess.
Jess:
?m <- (ACLMessage (sender ?n)...............)
(send ?m)
Java:
public String getName() {
return ("send");
}
public Value call(ValueVector vv, Context context)
throws JessException {
if (vv.get(1).type() == RU.VARIABLE) {
vv.get(1).factValue(context).getFactId());
vv = context.getEngine().findFactByID(vv.get(1)
.factValue
(context)
.getFactId());
}
This work with one Fact. How can I send now 10 Facts?
Each Fact has an ID. But I can not read them in Jess. I would like to
use an while loop like this.
i=0;
while (i !=9){
send fact_by_id(i);
i++
}
Is this possible in Jess.