I think D. Lopez-De-Ipina wrote:

> Actually what I would like to do is to pass as argument a new fact
> ...  The idea is that the function in Java receives as argument the
> new fact and can later map the fact contents into a Structured Event
> defined as a set of name-value pairs that is later transmitted to
> registered parties. If I received the argument in the form of a fact
> I wouldn't need to parse the arguments and I could use the Fact
> class interface to extract each of the components of that fact. Is
> there something that it could be done to pass the fact directly?

There isn't a good way to create a Fact object from Jess, other than
by 1) asserting it, or 2) using reflection to construct it. If it's OK
to assert the Fact, then assert returns the fact-id which in Jess 6 is
the actual fact object itself. You can therefore say

(function-that-wants-a-fact-as-an-argument (assert (some-fact)))

>  Another problem I am facing is that some of the events that arrive
> to my agent are represented by nested structures, i.e. within a
> structure another structure is contained. I would like to map such
> event to an unordered fact in CLIPS, containing nested
> slots. However I believe that is not possible, is that correct? Is
> there a workaround for it? 

You're correct that there is no way to create arbitrarily nested lists
in Jess. In fact, your efforts in trying to create them will generally
be rewarded by Jess fighting you and trying to flatten them out!  But
Jess has the ability to manipulate arbitrary Java data structures, so
just define the nested classes in Java and then create and manipulate
them in Jess using new, call, set, get, set-member and get-member.





---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
Org. 8920, MS 9012                  [EMAIL PROTECTED]
PO Box 969                  http://herzberg.ca.sandia.gov
Livermore, CA 94550

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