That worked. 

Thanks Alan.
-Bijal

---- Original message ----
>Date: Wed, 18 Dec 2002 17:31:11 -0800
>From: "Alan Moore" <[EMAIL PROTECTED]>
>Subject: RE: JESS: JavaBean String property doesn't match on 
LHS pattern.
>To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
>
>Change your rule to:
>
>(defrule tcr2
>   (tc (status "fail") (OBJECT ?tc)) 
>   => 
>   (printout t "Found match for status=fail" crlf)
>)
>
>Matching Strings on the lhs must be enclosed in quotes.
>
>alan
>
>-----Original Message-----
>From: Bijal Modi [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, December 18, 2002 4:48 PM
>To: [EMAIL PROTECTED]
>Subject: JESS: JavaBean String property doesn't match on LHS 
pattern.
>
>
>Hello,
>
>I have a simple JavaBean  class TestCase as follows:
>
>public class TestCase {
>    private int domainID;
>    private String status;
>
>    public TestCase() {
>        super();
>    }
>    public int getDomainID() {
>        return domainID;
>    }
>    public void setDomainID(int newDomainID) {
>        domainID = newDomainID;
>    }
>    public java.lang.String getStatus() {
>        return status;
>    }
>    public void setStatus(java.lang.String newStatus) {
>        status = newStatus;
>    }
>
>}
>
>
>I create the template for it in Jess using defclass:
>
>(defclass tc TestCase)
>
>and define a definstance tc1 as follows:
>
>(bind ?tc1 (new TestCase))
>(set ?tc1 status fail)
>(set ?tc1 domainID 1)
>(definstance tc ?tc1 static)
>
>and define two rules:
>
>(defrule tcr1
>   (tc (domainID 1) (OBJECT ?tc)) 
>   => 
>   (printout t "Found match for domainID=1" crlf)
>)
>
>(defrule tcr2
>   (tc (status fail) (OBJECT ?tc)) 
>   => 
>   (printout t "Found match for status=fail" crlf)
>)
>
>Now when I run the Rule Engine, tcr1 gets fired but tcr2 
>doesn't and I can't figure out why. I was expecting both 
>rules to fire since the definstance tc1 has appropriate data.
>
>thanks for your help,
>
>-Bijal
>
>-------------------------------------------------------------
-------
>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 owner-jess-
[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 owner-jess-
[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]
--------------------------------------------------------------------

Reply via email to