[jboss-jira] [JBoss JIRA] (DROOLS-1397) Drools condition cannot retrieve object from Map with Enum key

Patrick Mingard (JIRA) issues at jboss.org
Thu Jan 5 06:53:00 EST 2017


     [ https://issues.jboss.org/browse/DROOLS-1397?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Mingard updated DROOLS-1397:
------------------------------------
    Workaround Description: 
As proposed on the stackoverflow topic, this works :

{code:java}
rule comms
when
  $conv: Convention()
  $comm: Comm() from (ArrayList)($conv.getComms()).get(Type.AAA)
then [...]
{code}

Please note the difference is an ArrayList cast (with a few parentheses). 

  was:
As proposed on the stackoverflow topic, this works :

rule comms
when
  $conv: Convention()
  $comm: Comm() from (ArrayList)($conv.getComms()).get(Type.AAA)
then [...]

Please note the difference is an ArrayList cast (with a few parentheses). 



> 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
>             Fix For: 7.0.0.CR1
>
>
> 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-retrieve-object-from-map-with-enum-key] for details.



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the jboss-jira mailing list