A bit more information. I changed the name/qualifiedName tests to use the "old" style (parens) syntax and everything works. But now I'm curious. Is this a bug or is there an explanation for this behavior? Thanks.
-Russ -----Original Message----- From: Rogers, Russell (Watertown) Sent: Tuesday, June 03, 2008 4:22 PM To: '[email protected]' Subject: Inconsistent Matching behavior I have a pretty simple rule that matches a pair of facts, each with a different name. Facts are named and also have a namespace, which allows for a qualified name of the form <namespace>:<name>. I'm testing for specific names. When both patterns use the same slot (name or qualifiedName), the rule does not match. But if I use the qualifiedName slot on one and the name slot for the second, it works. Can anyone point me in the right direction for things to look at? It feels like the Rete network is confusing the two cases when in fact they are different. -Russ --------------------------------------- Details: I have a small set of facts I'm testing with. One DataUnit which has two associated MetricValues and one orphan Metric Value. f-1 (MAIN::DataUnit (attributeCount 0) (attributeValues <Java-Object:java.util.HashSet>) (attributes <Java-Object:java.util.HashSet>) (children <Java-Object:java.util.HashSet>) (class <Java-Object:java.lang.Class>) (facts <Java-Object:java.util.HashSet>) (id 0) (name "d503") (namespace <Java-Object:com.ims.pharmetrics.qaf.core.Namespace>) (previous nil) (qualifiedName "TEST:d503") (savg <Java-Object:com.ims.pharmetrics.qaf.core.SAVG>) (segmentation <Java-Object:com.ims.pharmetrics.qaf.core.Segmentation>) (unsegmented TRUE) (OBJECT <Java-Object:com.ims.pharmetrics.qaf.core.DataUnit>)) f-2 (MAIN::MetricValue (attributeCount 2) (attributeValues <Java-Object:java.util.HashSet>) (attributes <Java-Object:java.util.HashSet>) (class <Java-Object:java.lang.Class>) (dataUnit <Java-Object:com.ims.pharmetrics.qaf.core.DataUnit>) (savg <Java-Object:com.ims.pharmetrics.qaf.core.SAVG>) (segmentation <Java-Object:com.ims.pharmetrics.qaf.core.Segmentation>) (unsegmented FALSE) (value 3124) (OBJECT <Java-Object:com.ims.pharmetrics.qaf.core.MetricValue>) (aggregatable FALSE) (fact <Java-Object:com.ims.pharmetrics.qaf.core.Metric>) (id 0) (name "RecordCount") (namespace <Java-Object:com.ims.pharmetrics.qaf.core.Namespace>) (property FALSE) (qualifiedName "TEST:RecordCount")) f-3 (MAIN::MetricValue (attributeCount 2) (attributeValues <Java-Object:java.util.HashSet>) (attributes <Java-Object:java.util.HashSet>) (class <Java-Object:java.lang.Class>) (dataUnit <Java-Object:com.ims.pharmetrics.qaf.core.DataUnit>) (savg <Java-Object:com.ims.pharmetrics.qaf.core.SAVG>) (segmentation <Java-Object:com.ims.pharmetrics.qaf.core.Segmentation>) (unsegmented FALSE) (value 42632) (OBJECT <Java-Object:com.ims.pharmetrics.qaf.core.MetricValue>) (aggregatable FALSE) (fact <Java-Object:com.ims.pharmetrics.qaf.core.Metric>) (id 0) (name "RecordCount") (namespace <Java-Object:com.ims.pharmetrics.qaf.core.Namespace>) (property FALSE) (qualifiedName "TEST:RecordCount")) f-4 (MAIN::MetricValue (attributeCount 1) (attributeValues <Java-Object:java.util.HashSet>) (attributes <Java-Object:java.util.HashSet>) (class <Java-Object:java.lang.Class>) (dataUnit <Java-Object:com.ims.pharmetrics.qaf.core.DataUnit>) (savg <Java-Object:com.ims.pharmetrics.qaf.core.SAVG>) (segmentation <Java-Object:com.ims.pharmetrics.qaf.core.Segmentation>) (unsegmented FALSE) (value 25000) (OBJECT <Java-Object:com.ims.pharmetrics.qaf.core.MetricValue>) (aggregatable FALSE) (fact <Java-Object:com.ims.pharmetrics.qaf.core.Metric>) (id 0) (name "Threshold") (namespace <Java-Object:com.ims.pharmetrics.qaf.core.Namespace>) (property FALSE) (qualifiedName "PMPM:Threshold")) I have the following rule: (defrule TestRule ?du <- (DataUnit (name ?du_name) (OBJECT ?du_obj)) (MetricValue {qualifiedName == "TEST:RecordCount"} (dataUnit ?du_obj) (OBJECT ?foo_obj) ) (MetricValue {name == "Threshold"} (OBJECT ?bar_obj) ) => (printout t "Evaluated " ?du_name " crlf)) This works fine (fires twice). It also works if I change it so that the second MetricValue has a qualifiedName and the first does not. (defrule TestRule ?du <- (DataUnit (name ?du_name) (OBJECT ?du_obj)) (MetricValue {name == "RecordCount"} (dataUnit ?du_obj) (OBJECT ?foo_obj) ) (MetricValue {qualifiedName == "PMPM:Threshold"} (OBJECT ?bar_obj) ) => (printout t "Evaluated " ?du_name " crlf)) But when I use change the MetricValue tests to both use the same slot , I get no matches. e.g. (defrule TestRule ?du <- (DataUnit (name ?du_name) (OBJECT ?du_obj)) (MetricValue {qualifiedName == "TEST:RecordCount"} (dataUnit ?du_obj) (OBJECT ?foo_obj) ) (MetricValue {qualifiedName == "PMPM:Threshold"} (OBJECT ?bar_obj) ) => (printout t "Evaluated " ?du_name " crlf)) -------------------------------------------------------------------- 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] --------------------------------------------------------------------
