jess-users  

Re: JESS: Multiple shadow facts

Ernest Friedman-Hill
Sun, 29 Nov 2009 09:49:27 -0800

"get-member" returns the value of an actual member variable, using the exact name of the variable. It works only on accessible members.

"get" works on JavaBeans properties; you pass the name of the property ("foo") and Jess calls the accessor method ("getFoo") to get the value.

So presumably your bean class "B" does not have a public member variable "sB" -- not at all surprising!


On Nov 29, 2009, at 7:59 AM, Marco Zappatore wrote:


I answer to myself:
if you substitute "get-member" with "get" in myRule1 (see quotation) it
works.



Marco Zappatore wrote:


Dear JESS users,
I'm working with shadow facts and my question is the following:
let's suppose I have 3 java beans
1) A (with slot sA)
2) B (with slot sB)
3) C

the type for the sA slot is the java bean B itself and the type for the sB
slot is C.

First I definstanced C, then I definstanced B. I used the OBJECT slot of
the
shadow fact C as content for sB and I retracted C.
Finally I definstanced A. I filled again the sA slot with the OBJECT slot
of
the shadow fact B and I retracted B too.
Now I have to write a rule that has to verify directly in A whether or not
C
is in sB.

My trials:

(defrule myRule1
?f <- (A (sA ?a &: (instanceof (get-member ?a sB) C))
=>
;do something)

(defrule myRule2
?f <- (A (sA ?a))
 (B (OBJECT ?a) (sB ?b &: (instanceof ?b C)))
=>
;do something)

didn't work...
Any idea?

Many thanks in advance
 Marco Zappatore
--
View this message in context:
http://old.nabble.com/Multiple-shadow-facts-tp26558321p26558321.html
Sent from the Jess mailing list archive at Nabble.com.



--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users y...@address.com '
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov .
--------------------------------------------------------------------




--
View this message in context: 
http://old.nabble.com/JESS%3A-Multiple-shadow-facts-tp26558518p26560670.html
Sent from the Jess mailing list archive at Nabble.com.



--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov .
--------------------------------------------------------------------

---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences, Sandia National Laboratories
PO Box 969, MS 9012, Livermore, CA 94550
http://www.jessrules.com







--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.
--------------------------------------------------------------------