hi, there,

I just got a wired problem with jess.Fact class. In rule file, I defined
a fact template and asserted several facts based on the template. Then
in my java program, I was trying to get slot value as follows:

 public Task (Rete rete, Fact fact, int id) {
  try {
   setID(id);
   setObject(fact.getSlotValue("object").toString());

setRequirements(fact.getSlotValue("requirements").listValue(rete.getGlobalContext()));


setConstraints(fact.getSlotValue("constraints").listValue(rete.getGlobalContext()));

   Hashtable h = new Hashtable();

h.put("elaboration",fact.getSlotValue("elaboration").listValue(rete.getGlobalContext()));


h.put("dependency",fact.getSlotValue("dependency").listValue(rete.getGlobalContext()));

   setRelation(h);
   setStatus(fact.getSlotValue("status").toString());

setDuration((int)fact.getSlotValue("duration").numericValue(rete.getGlobalContext()));

   setPriority(0);
   System.out.println("Creating task "+String.valueOf(id)+" ...");
  }
  catch (JessException je) {
   System.out.println(je);
  }
 }

However, I always got error report from jess as "Jess reported an error
in routine Fact.findSlot, Message: Attempt to access invalid slotname
object." for the first time use of getSlotValue. In above case, say
getSlotValue("object"). Did someone have the same problem before? Any
suggestions and advice are greatly appreciated.

thanks,
David

---------------------------------------------------------------------
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]
---------------------------------------------------------------------

Reply via email to