mariofusco opened a new issue, #1077:
URL: https://github.com/apache/incubator-kie-issues/issues/1077
The following reproducer
```
public static class ClassWithGenericField<P extends Address> {
private P extendedAddress;
public ClassWithGenericField(final P extendedAddress) {
this.extendedAddress = extendedAddress;
}
public P getExtendedAddress() {
return extendedAddress;
}
public void setExtendedAddress(final P extendedAddress) {
this.extendedAddress = extendedAddress;
}
}
@Test
public void testClassWithGenericField() {
String str =
"import " + ClassWithGenericField.class.getCanonicalName() +
";\n " +
"import " + List.class.getCanonicalName() + ";\n " +
"global List results;\n " +
"rule R when\n " +
" ClassWithGenericField($addressStreet:
extendedAddress.street) \n " +
"then\n " +
" results.add($addressStreet);\n " +
"end";
KieSession ksession = getKieSession(str);
List<String> results = new ArrayList<>();
ksession.setGlobal("results", results);
final Address address = new Address("someStreet", 1, "Levice");
final ClassWithGenericField<Address> classWithGenericField = new
ClassWithGenericField<>(address);
ksession.insert(classWithGenericField);
assertThat(ksession.fireAllRules()).isEqualTo(1);
}
```
works with interpreted drl, but fails the generation of the executable model
```
15:14:21.111 [main] ERROR
o.d.c.k.b.impl.AbstractKieProject.buildKnowledgePackages:280 - Unable to build
KieBaseModel:defaultKieBase
InvalidExpressionErrorResult: Unknown field street on P
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]