How can I combine slots (shadow facts) from different deftemplates in the same clp file.
I need a rule of the form: (defrule Test-rule (Beanclass1 {slot1 == "stringvalue" }) AND!!!! (Beanclass2 {slot2 == "closed"}) => (printout t "FIRE!!" crlf) I am running runUntilHalt through api calls and rete.add/update for adding the knowledge. I have found that the problem is located in the rule since the getSlot1 and getSlot2 are called normally. Any help please? thanks. On Thu, 30 Oct 2008, John Chrysakis wrote: > Hello to jess community, > > I have a problem with the patterns of a rule > > In my clp file I have defined: > > (deftemplate Door(declare (from-class Door ))) > (deftemplate User(declare (from-class User ))) > > > (defrule MainDoor-rule > (Door {mainDoorState == "closed"}) > (User {userLocation == "NearDoorRegion" }) > > => > > (printout t "@@@ YES @@@:" crlf)) > > > Door,User are the Bean classes which contain the required methods: > getmainDoorState, getuserLocation > > I add an instance of each class into WM but the rule never fires even > though it calls correctly the above methods. > > But if I try to reject one LHS condition , the rule fires normally... > Why this happens? > > Should I add something to the syntax of the rule > in order to check both conditions?? > > thanks in advance, > > > > -------------------------------------------------------------------- > 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] > -------------------------------------------------------------------- > > -------------------------------------------------------------------- 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] --------------------------------------------------------------------