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

Field "class" not recognized in some constructs

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      Given this simple type:

      declare Foo
      clazz : Class
      end

      and this rule:

      rule yyy
      when
      $f: Foo( $cl: clazz == ( java.lang.String.class ) )

          1. $f: Foo( $cl: clazz, eval( $f.getClazz().equals( java.lang.String.class ) ) )
          2. $f: Foo( $cl: clazz == java.lang.String.class )
            then
            System.out.println( "--- got a " + $cl );
            end

      Only the first vyariant is accepted by the DRL parser. Other forms are
      rebuked with, e.g.:

      Unable to Analyse Expression $f.getClazz().equals( java.lang.String.class ) :
      [Error: Failed to compile: 2 compilation error(s):

      • (1,24) unable to resolve method using strict-mode: ex10.Foo.java()
      • (1,24) unqualified type in strict mode for: java]
        [Near : {... $f.getClazz().equals( java.lang.String.class ) ....}

        ]
        ^
        [Line: 1, Column: 24] : [Rule name='yyy']

      Note the incorrect line number!

            etirelli@redhat.com Edson Tirelli
            laune Wolfgang Laun (Inactive)
            Archiver:
            rhn-support-ceverson Clark Everson

              Created:
              Updated:
              Resolved:
              Archived: