]
Mario Fusco updated DROOLS-3560:
--------------------------------
Sprint: 2019 Week 05-07
Compiler error in executable model when there is a clash between a
field and a class name
-----------------------------------------------------------------------------------------
Key: DROOLS-3560
URL:
https://issues.jboss.org/browse/DROOLS-3560
Project: Drools
Issue Type: Bug
Reporter: Mario Fusco
Assignee: Mario Fusco
Priority: Major
[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}