Uploaded image for project: 'Red Hat Decision Manager'
  1. Red Hat Decision Manager
  2. RHDM-834

Compiler error in executable model when there is a clash between a field and a class name

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 7.3.0.GA
    • 7.1.1.GA
    • BRE
    • None
    • CR1
    • +

    Description

      [ERROR] Unable to build KieBaseModel:rules
      InvalidExpressionErrorResult: Unknown field HELLO on class java.lang.String
      InvalidExpressionErrorResult: Unknown field GOODBYE on class java.lang.String

      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 5.207 s
      [INFO] Finished at: 2019-01-28T18:10:43+09:00
      [INFO] Final Memory: 64M/657M
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.kie:kie-maven-plugin:7.14.0.Final-redhat-00002:generateModel (default-generateModel) on project HelloWorld: Execution default-generateModel of goal org.kie:kie-maven-plugin:7.14.0.Final-redhat-00002:generateModel failed: Unable to get KieModule, Errors Existed: Error Messages:
      [ERROR] Message [id=1, kieBase=rules, level=ERROR, path=com/sample/Sample.drl, line=-1, column=0
      [ERROR] text=Unknown field HELLO on class java.lang.String]
      [ERROR] Message [id=2, kieBase=rules, level=ERROR, path=com/sample/Sample.drl, line=-1, column=0
      [ERROR] text=Unknown field GOODBYE on class java.lang.String]
      [ERROR]
      [ERROR] Warning Messages:
      [ERROR]
      [ERROR] Info Messages:
      ...

      Here is problematic DRL.

      package com.sample
      
      import com.sample.Message;
      
      rule "Hello World"
          when
              m : Message( status == Message.HELLO, myMessage : message )
          then
              System.out.println( myMessage );
              m.setMessage( "Goodbye cruel world" );
              m.setStatus( Message.GOODBYE );
              update( m );
      end
      
      rule "GoodBye"
          when
              Message( status == Message.GOODBYE, myMessage : message )
          then
              System.out.println( myMessage );
      end
      

      Attachments

        Issue Links

          Activity

            People

              mfusco@redhat.com Mario Fusco
              rhn-support-hmiura Hiroko Miura
              Tibor Zimányi Tibor Zimányi
              Tibor Zimányi Tibor Zimányi
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: