[
https://issues.jboss.org/browse/DROOLS-1418?page=com.atlassian.jira.plugi...
]
Matteo Mortari commented on DROOLS-1418:
----------------------------------------
Simplified reproducer:
{code:java}
public static class MapHolder {
private Map<String, List<String>> fieldMap;
public Map<String, List<String>> getFieldMap() {
return fieldMap;
}
public void setFieldMap(Map<String, List<String>> fieldMap) {
this.fieldMap = fieldMap;
}
}
@Test
public void testMapOperatorWithPojoGenerics() {
String drl1 = "package
"+this.getClass().getPackage().getName()+";\n" +
"import " + MapHolder.class.getCanonicalName() + ";\n"
+
"rule R1 when\n" +
" MapHolder( $a : fieldMap[\"keyA\"] )\n" +
"then\n" +
" System.out.println($a);\n" +
"end\n" +
"";
KieSession kieSession = new KieHelper()
.addContent(drl1, ResourceType.DRL)
.build().newKieSession();
Map<String, List<String>> items = new HashMap<>();
items.put("keyA", new ArrayList<String>() {{ add("a");
}});
// go !
MapHolder m = new MapHolder();
m.setFieldMap(items);
kieSession.insert(m);
assertEquals(1, kieSession.fireAllRules() );
}
{code}
Binding of List stored in Map doesn't work in special case
----------------------------------------------------------
Key: DROOLS-1418
URL:
https://issues.jboss.org/browse/DROOLS-1418
Project: Drools
Issue Type: Bug
Components: core engine
Affects Versions: 7.0.0.Beta5
Reporter: Jozef Marko
Assignee: Mario Fusco
Labels: dtable_testday_preparation, reported-by-qe
Attachments: reproducer.zip
User has possibility to bind a List stored as item of a Map in his rule. However this
dosn't work in one special case. For more details see the steps to reproduce.
This issue was discussed with [~tari_manga] and he also provided the workaround used in
reproducer. Thanks.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)