[jboss-jira] [JBoss JIRA] Created: (JBRULES-1083) Brackets are not always optional for non-existential quantifier "not"

Markus Reitz (JIRA) jira-events at lists.jboss.org
Tue Aug 14 17:06:06 EDT 2007


Brackets are not always optional for non-existential quantifier "not" 
----------------------------------------------------------------------

                 Key: JBRULES-1083
                 URL: http://jira.jboss.com/jira/browse/JBRULES-1083
             Project: JBoss Rules
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: Drl Parser/Builder
    Affects Versions:  4.0.0.GA
            Reporter: Markus Reitz
         Assigned To: Mark Proctor
            Priority: Minor


According to the documentation, brackets are optional as illustrated by

  Example 6.37. No Busses

  not Bus()

In case of the rule (class SpecialString in http://jira.jboss.com/jira/browse/JBRULES-1079)

  package test

  rule "Brackets"

    when
      not exists(x : SpecialString() and
                 forall(y : SpecialString(this!=x)
                            SpecialString(this==y, text=="Universe")))

    then
      System.out.println("Condition satisfied");
  end

this is not true. Trying to load this rule leads to

org.drools.rule.InvalidRulePackage: [8,8]: unknown:8:8 Unexpected token 'exists'
at org.drools.rule.Package.checkValidity(Package.java:408)
at org.drools.common.AbstractRuleBase.addPackage(AbstractRuleBase.java:288)
at DroolsTest.<init>(Unknown Source)
at DroolsTest.main(Unknown Source)

When brackets are added:

  package test

  rule "Brackets"

    when
      not(exists(x : SpecialString() and
                 forall(y : SpecialString(this!=x)
                            SpecialString(this==y, text=="Universe"))))

    then
      System.out.println("Condition satisfied");
  end

rule loading works without any exceptions.

-- 
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