Sajindra Jayasena wrote:
Hi All, I am new to Jess . I am trying out to develop a customizable rule engine as a university degree
project that could be used by java applications. I have done the
customizing interfaces for facts etc but facing problrm with working with
the Rule. I found that (defrule ... ) is the command to create a rule . But facing
problen in defining the RHS of the rule for e.g. If I create a rule where the LHS is ((customer ?name ?age new ) and the RHS would be
=> (discount = 35 ) - this syntax is incorrect i think . If I explain the scenarion , what would happen is for any customer fact if
his status is new , the discount that is applied to him is 35 ) . the problems I am facing are : 1. How to define the RHS ? 2. how can I get the out put of this rule ? 3. do i have to write jess functions?
How about:
(deftemplate customer (slot status) (slot discount)) (assert (customer (status "new"))) (defrule new-discount ?customer-fact <- (customer (status "new") (discount nil)) => (modify ?customer-fact (discount 35))) -- Richard Kasperowski Tel: 617-576-1552, Fax: 617-576-2441 mailto:[EMAIL PROTECTED] http://www.altisimo.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] --------------------------------------------------------------------
