Re: JESS: Rule LHS patterns and multiple hierarchical object models.

2009-09-07 Thread Nguyen, Son
Thanks, Mike, for offering other solutions. It is always refreshing to see different solutions to the same problem As to the idea of writing methods to assist, it is not a viable solution for me because my solution has to be dynamic as the end users can pick and choose whatever fields of a data

Re: JESS: Rule LHS patterns and multiple hierarchical object models.

2009-09-07 Thread Socrates Frangis
I agree with the same, that adding a method to your Java class would make the comparisons a lot easier. One thing you might not have noticed or considered was that your getters/setters are not neccesary in the way you designed your Java beans. Since your class members are public you can do a

JESS: Rule LHS patterns and multiple hierarchical object models.

2009-09-04 Thread Nguyen, Son
Hi, My goal is to have logical expressions in rule LHS involving multiple templates derived from hierarchical Java models: public class PO { public Customer customer; // setter, getter not shown. } public class Customer { public String name; public Address

Re: JESS: Rule LHS patterns and multiple hierarchical object models.

2009-09-04 Thread Michael Smith
(defrule rule (Customer (address ?address)) (PO (customer ?customer)) (test (= 0 (str-compare ((?customer getAddress) getStreet) (? address getStreet = (bind ?name (?customer getName)) (bind ?addr (?address getStreet)) (printout t ?addr : customer: ?name crlf)