I think I have resolved my internal confusion. I am thinking about Jess rules as being type-safe, which is nonsense. So if I have a rule file that refers to some kind of fact that does not exist, there will be no error - the rules that depend on that fact simply will not fire. So if I instantiate the relevant fact from within Java, then the rules will fire. So my question about "how does the rule file know about a shadow fact" is meaningless - the rule file doesn't care.

Am I understanding this correctly?


On Jul 17, 2006, at 7:26 AM, friedman_hill ernest j wrote:

I think mdean77 wrote:
Ridiculous question.  I have a Bean in Java.  I want to have Jess
build itself a template for a shadow fact.  But Jess does not know
about the Bean.  How does one tell Jess about the classes that have
been created in Java?  Right now, I manually create a fact in Jess
and move the values from Java, but this is not ideal.


In Jess 7, you can use Rete.add(), which automatically creates the
template if needed and adds the object to working memory.  In Jess 6
-- or if you want to choose your own template name rather than using
the class name -- you can use the Rete.defclass() and
Rete.definstance() methods.

The manual section concerning templates, facts, and Java objects in
working memory has been completely rewritten for the next release -- I
hope it will make this stuff easier to learn and use.




---------------------------------------------------------
Ernest Friedman-Hill
Advanced Software Research          Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [EMAIL PROTECTED]
Livermore, CA 94550         http://herzberg.ca.sandia.gov
--------------------------------------------------------------------
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 owner-jess- [EMAIL PROTECTED]
--------------------------------------------------------------------

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