apache / incubator-kie-drools

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

Add explanation for "Generics return type resolution" in migration guide #5931

Closed tkobayas closed 5 months ago

tkobayas commented 6 months ago

Add more explanation to https://docs.drools.org/latest/drools-docs/drools/migration-guide/index.html#_generics_return_type_resolution

A) Vehicle.getMotor() is defined to return TEngine. Drools can get that TEngine is bound to Engine class, but Engine doesn't have property "adBlueRequired". Hence results in the error. "#" is syntax to specify the sub class.

B) DieselCar.getEngine() is defined to return DieselEngine. So the rule can access "adBlueRequired".

exec-model generates java codes from rules (for faster KiePackage/KieBase build), so those static class information is crucial while non-exec-model can resolve the value at rule execution time.

tkobayas commented 5 months ago

Fixed by https://github.com/apache/incubator-kie-drools/commit/785ef86a9a774db20f8610a1b73f4d5cdb635eb4 , so no need to enhance the document.

https://issues.redhat.com/browse/DROOLS-7197