Hello -
I'm trying to learn how to properly get Jess and my Java code to work together. To do
so I've come up with what I believe should be a fairly simple test.
I created a 2 classes, Person and Address. Person has an attribute age and the
aappropriate accessors, and also has an address and the appropriate accessors.
Address has, for now, only one attribute, state, and the accessors. In addition,
Person has an attribute comment and its accessors.
I want to have a rule that says basically:
If a person is over 25 and lives in NY, set the comment to "Got one".
What I thought I would do is create a Rete object from my Java program, create an
instance of Person and its Address, and then store the Person object into the Rete
object. However, I cannot figure out exactly what the rule should look like,
specifically the LHS.
Do I need to do a definstance, or will Jess associate the stored object to a fact?
And once Jess knows the object, how do I write a LHS of a rule to say that it should
get the Person's Address's state? I've managed to do something like "If a person is
over 25 set the comment" but I don't know if that was really correct since I had a
startup rules that asserted facts from stored objects, but that wouldn't work well in
a real system.
Thanks for your help...I hope this is descriptive enough. It's obviously a very
simplified version of what I really want to ultimately do.
--== Sent via Deja.com http://www.deja.com/ ==--
Before you buy.
---------------------------------------------------------------------
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]
---------------------------------------------------------------------