[
https://issues.jboss.org/browse/DROOLS-1397?page=com.atlassian.jira.plugi...
]
Patrick Mingard updated DROOLS-1397:
------------------------------------
Steps to Reproduce:
A fact :
{{ public class Convention {
[...]
private Map<ECommissionType, List<Commission>> commissions = new
HashMap<>();
[...]
}}}
An enumeration :
{{ public enum ECommissionType {
ACQ,RIS,POF,[...]
}}}
And a rule condition assuming $convention is properly initialized in a former condition
and is an instance of the Convention class shown) :
$comm : Commission() from $convention.getCommissions().get(ECommissionType.$1)
Compilation using kie-maven-plugin is raising an error :
Unable to Analyse Expression $convention.getCommissions().get(ECommissionType.RIS)):
sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl cannot be cast to
java.lang.Class : [Rule name='B_CommissionLigne_98']
was:
A fact :
public class Convention {
[...]
private Map<ECommissionType, List<Commission>> commissions = new
HashMap<>();
[...]
}
An enumeration :
public enum ECommissionType {
ACQ,RIS,POF,[...]
}
And a rule condition assuming `$convention` is properly initialized in a former condition
and is an instance of the `Convention` class shown) :
$comm : Commission() from $convention.getCommissions().get(ECommissionType.$1)
Compilation using kie-maven-plugin is raising an error :
Unable to Analyse Expression $convention.getCommissions().get(ECommissionType.RIS)):
sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl cannot be cast to
java.lang.Class : [Rule name='B_CommissionLigne_98']
Drools condition cannot retrieve object from Map with Enum key
--------------------------------------------------------------
Key: DROOLS-1397
URL:
https://issues.jboss.org/browse/DROOLS-1397
Project: Drools
Issue Type: Bug
Components: core engine, decision tables
Affects Versions: 6.5.0.Final
Environment: JDK 1.7, JUnit test, exact drools version is 6.5.0.Final-redhat-2
Reporter: Patrick Mingard
Assignee: Mario Fusco
Priority: Minor
I'm migrating an application that used drools 5.3 on the newer drools 6.5 version.
I'm using a decision table, And one of my condition is accessing a Map which has an
enum class as a key. It is not compiling unless I do a strange ArrayList cast.
Please refer to [this stackoverflow
topic|http://stackoverflow.com/questions/41461468/drools-condition-cannot...]
for details.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)