[jboss-jira] [JBoss JIRA] (DROOLS-3561) Compiler error in executable model when there is a clash between a field and a class name

Hiroko Miura (Jira) issues at jboss.org
Mon Jan 28 06:44:03 EST 2019


Hiroko Miura created DROOLS-3561:
------------------------------------

             Summary: Compiler error in executable model when there is a clash between a field and a class name
                 Key: DROOLS-3561
                 URL: https://issues.jboss.org/browse/DROOLS-3561
             Project: Drools
          Issue Type: Bug
            Reporter: Hiroko Miura
            Assignee: Mario Fusco


[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.
{code}
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
{code}



--
This message was sent by Atlassian Jira
(v7.12.1#712002)


More information about the jboss-jira mailing list