You mean like an "instanceof" test?

(defrule do-if-jb2
  (JB1 (some-slot ?x&:(instanceof ?x com.whatever.JB2)))
  =>
  ...



On Jul 26, 2009, at 5:57 PM, [email protected] wrote:

Dear JESS users and devs,
I have to write a group of rules dealing with nested
java beans. The (simplified) scenario is the following:

1) let's suppose I
have three Java beans: JB1, JB2 and JB3; both JB2 and JB3 can be slots of JB1; JB2 and JB3 have normal slots (with different data types but without other
nested Java beans)
2) I also have proper templates, created on the basis of the
corresponding java beans (declare jb1 from-class ...)
3) the shadow facts have
been added to the working memory using (definstance ...)

Now I have to write a
rule in order to activate something if JB1 has JB2 as slot and something else on the other case. How can I implement the matching between the slot of JB1 and
the template of JB2 and JB3? Calling "equals" method doesn't work....
In other
words, at this level I have to verify only which Java bean is a slot of JB1
without considering the slots of JB2 and JB3
Is there another way to do that?


Thanks in advance for your replies.
 Marco Zappatore


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

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