How about adding it as a defglobal, initialized to the proper value:

  Foo foo = new Foo();
  Defglobal g = new Defglobal();
  g.addGlobal("*foo*", new Value(foo, RU.EXTERNAL_ADDRESS));
  rete.addDefglobal(g);

Now ?*foo* will be initialized to the java object foo.  If you need it
as a fact you could assert it from java

  rete.executeCommand("(assert (foo-fact ?*foo*))");

or, to survive a reset, put it in a deffacts

  rete.executeCommand("(deffacts java-facts (foo-fact ?*foo*))");

On Tue, 28 Jul 1998, Ned Wolpert wrote:

} Folks-
}   I'm looking for the best way to 'assert' a java object into the jess
} rule engine... or something like this...
} 
}       (bind ?a aJavaObject)
}       (assert some-name-of-some-sort ?a)
} 
} I want to do this from the java side, after the rules have been entered, 
} before the '(run)' engine command is called.  What is the best way?
} (Perhaps it's best asked, what is the best way to assert a fact that contains
} a java object using the FUNCALL technique with ValueVectors?)



---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list. List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------

Reply via email to