To all,
Below are a few code snippits that are causing me trouble in a java program.
I get the Rete:
Rete jessRete = RuleBase.getRete();
I define a template as follows:
jessRete.executeCommand("(deftemplate SofInPlace-Filter (slot thing) " +
" (slot thing-id) (slot distance) (slot HIE-instance (type Object)))");
//The object is being passed in order to have access to a method in that
object
I then define a rule to trigger:
jessRete.executeCommand(
"(defrule SofInPlace-Trigger" +
" (declare (salience 100)) " +
" (SofInPlace-Filter (thing ?thing) (thing-id ?thing-id) " +
" (distance ?distance&:" +
" (<= ?distance 250)) " +
" (HIE-instance ?HIEobject)) " +
"=>" +
"(call ?HIEobject triggerAlert (new java.lang.String thing) " +
" (new java.lang.String thing-id)))");
Later in the program I pump data into these slots:
Fact f = new Fact("SofInPlace-Filter", jessRete);
f.setSlotValue("unit", new jess.Value(unitName, jess.RU.STRING));
f.setSlotValue("unit-id", new jess.Value(unitID, jess.RU.STRING));
f.setSlotValue("distance", new jess.Value(distFromAoi,
jess.RU.FLOAT));
f.setSlotValue("HIE-instance", new jess.Value((Object) SofHie));
if(jessRete.assert(f) != -1)
{
getHIEFactsVector().add(f);
}//end if
else
{
System.out.println("We were not able to assert our fact.");
}//end else
I check to make sure all data that is being pumped in the fact is valid. I
have
pumped in data that should fire (i.e. distance = 0). Anyone have any idea
why things aren't working?
NOTE: The majority of the java code has been omitted due to the size.
Thanks for your time,
Jeramy Ross
--------------------------------------------------------------------
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]
--------------------------------------------------------------------