Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-1116

"not" doesn't work for StatelessSessions

    XMLWordPrintable

    Details

      Description

      When using a StatelessSession, the "not" quantifier doesn't work. Test case below.

      package org.drools.examples

      rule "Hello World"
      when
      Integer()
      then
      System.out.println("Hello world");
      end

      rule "Goodbye World"
      when
      not Integer()
      then
      System.out.println("Goodbye cruel world");
      end

      public class TestReadRuleFile {

      public static void main(String[] args) throws Exception

      { PackageBuilder builder = new PackageBuilder(); InputStreamReader is = new InputStreamReader( TestReadRuleFile.class.getResourceAsStream("test.drl")); builder.addPackageFromDrl(is); Package pkg = builder.getPackage(); RuleBase jbossRulebase = RuleBaseFactory.newRuleBase(); jbossRulebase.addPackage(pkg); StatelessSession session = jbossRulebase.newStatelessSession(); session.execute(new Float(1)); }

      }

      The "Goodbye world" rule should fire (there are no Integers in the working memory) but doesn't. If you switch to a StatefulSession, the "Goodbye world" rule does fire.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                tirelli Edson Tirelli
                Reporter:
                deanjones Dean Jones
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: