Title: Multislot problem

Hello,

I am having a slight problem which is really really bugging me:

I have this rule:

(defrule bondMVMaxPCOutstanding::calcifnc
(declare (auto-focus TRUE))
(rulesfired (rules bondMVMaxPCOutstanding))
 ?b <- (grouped-facts (partitionname cusip)
                                                (summationvalue ?mv)
                                                (partitionvalue ?c)
                                                (factcollection $?fc&:(MAIN::checkifcontains productType CVBND $?fc)))
?fact <-  (MAIN::findwherecontains productType CVBND ?fc)
(test (>  (bondMVMaxPCOutstanding::compliant ?mv 1.0) ?*bondMVMaxPCOutstandingValue*))
  =>
. . . . . etc


Which uses this function:

(deffunction MAIN::findwherecontains (?detail ?value ?col)
"returns the fact with the particular details"
(foreach ?fact ?col
                (if (eq (str-compare (call ?fact getSlotValue ?detail) ?value) 0) then
                        (bind ?f ?fact) else
                        (return 0))
                        )
(if (exists ?f) then           
        (return ?f) else
                (return FALSE))
        )

?fact <-  (MAIN::findwherecontains productType CVBND ?fc) in the rule always stops the rule from activating. I do not understand why.

Factcollection is a multifield of facts. I want to retrieve the fact where productType is CVBND.
(MAIN::checkifcontains productType CVBND ?fc) succeeds so there is one in the slot, but the above line does not work.

Any idea,

Thanks in advance for your help!


Chirag


NOTICE: If received in error, please destroy and notify sender. Sender does not waive confidentiality or privilege, and use is prohibited.

Reply via email to