[jboss-jira] [JBoss JIRA] Created: (JBRULES-953) memberOf and not memberOf not working

Brian Enderle (JIRA) jira-events at lists.jboss.org
Wed Jun 27 13:16:57 EDT 2007


memberOf and not memberOf not working
-------------------------------------

                 Key: JBRULES-953
                 URL: http://jira.jboss.com/jira/browse/JBRULES-953
             Project: JBoss Rules
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: Drl Parser/Builder
    Affects Versions:  4.0.0.MR3
         Environment: Windows XP, Drools MR3
            Reporter: Brian Enderle
         Assigned To: Mark Proctor


The use of "memberOf" and "not memberOf" does not appear to do anything as it always evaluates to true.

Example:

given an Address object with countryCd of "US" & List of country codes of {"US", "MX" and "CA"}

rule "Country must be US, MX or CA"
   when
      $i : Address( countryCd != null, countryCd not memberOf countryCodes, $countryCd : countryCd )
   then
      System.out.println("- Country must be US, MX or CA");
end

rule "Country must not be US, MX or CA"
   when
      $i : Address( countryCd != null, countryCd memberOf countryCodes, $countryCd : countryCd )
   then
      System.out.println("- Country must not be US, MX or CA");
end

The results of these two rules is the following:
- Country must be US, MX or CA
- Country must not be US, MX or CA

One of these should not fire, in this case the first rule should not evaluate to true and therefore should not fire.

Brian Enderle

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list