Matching Java Objects

View: New views
1 Messages — Rating Filter:   Alert me  

Matching Java Objects

by Marco Zappatore :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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). More in detail, this beans are ontology classes created by using Beangenerator
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 some action if JB1 has JB2 as slot and in order to activate 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