Hello,

I have condition on LHS rule like below:

(deffunction checkProdEmpty (?security)
    (if (and (neq (get ?security prod) nil)(neq (get ?security prod) "")(
neq (get ?security prod) "0")) then
        (return FALSE)
     else
        (return TRUE))
    )

(defrule RuleFromFacts
    (declare (salience ?*CONTENT_SPECIFIC_RULE*) (no-loop TRUE))
    ?trade <- (TR (instrmt ?security &:(eq (checkProdEmpty ?security) TRUE
)))
        (or (SecurityDetails (isin ?isin &:(eq (get ?security ID) ?isin))
(cusip ?cusip) (bbid ?bbid)(prodType ?prodTyp))
        (SecurityDetails (isin ?isin) (cusip ?cusip  &:(eq (get ?security
ID) ?cusip)) (bbid ?bbid)(prodType ?prodTyp))
        (SecurityDetails (isin ?isin) (cusip ?cusip) (bbid ?bbid &:(eq (
get ?security ID) ?bbid))(prodType ?prodTyp)))
    =>
    (set ?security prod ?prodTyp)
    (modify ?trade (instrmt ?security))
    (log-info  " Set Prod from Facts - SecurityID: " (get ?security ID) "
Prod: " ?prodTyp)
)


There is 1 SecurtiDetails fact present with cusip same as bbid and hence
the rule is activated twice.
But when the first time rule fires it sets the property prod to something
not null.
It should ideally not fire for second activation.
But it still fires.
Any idea ?



Thanks and regards,
Nikita

************************************************************
HSBC Software Development (India) Pvt Ltd
HSBC Center Riverside,West Avenue ,
25 B Kalyani Nagar Pune  411 006 INDIA

Telephone: +91 20 26683000
Fax: +91 20 26681030
************************************************************


-----------------------------------------
*******************************************************************
This e-mail is confidential. It may also be legally privileged.
If you are not the addressee you may not copy, forward, disclose
or use any part of it. If you have received this message in error,
please delete it and all copies from your system and notify the
sender immediately by return e-mail.

Internet communications cannot be guaranteed to be timely,
secure, error or virus-free. The sender does not accept liability
for any errors or omissions.
*******************************************************************
"SAVE PAPER - THINK BEFORE YOU PRINT!"

Reply via email to