apache / incubator-kie-drools

Drools is a rule engine, DMN engine and complex event processing (CEP) engine for Java.
http://www.drools.org
5.85k stars 2.49k forks source link

exec-model doesn't report a build error when non-defined annotation is used with DRL6_STRICT #6039

Open tkobayas opened 2 months ago

tkobayas commented 2 months ago

With

System.setProperty("drools.lang.level", "DRL6_STRICT");
declare Person
    @author( Bob )
    @dateOfCreation( 01-Feb-2009 )

    name : String @key @maxLength( 30 )
    dateOfBirth : Date
    address : Address
end

non-exec-model reports build errors.

Unknown annotation: author
Unknown annotation: dateOfCreation
Unknown annotation: MaxLength
Unknown annotation: key

But exec-model silently ignores the problem.

tkobayas commented 1 month ago

lower priority

JaredDavis22 commented 1 month ago

Sorry to keep going on this.

Should key be in the list of unknown annotations? I would expect key, position and the other internally implemented annotations would be handled without error regardless of drools.lang.level setting.

tkobayas commented 1 month ago

@JaredDavis22 "DRL6_STRICT" is very strict that it doesn't accept the lower case @key. If you change it to @Key, it is handled :)