[jboss-jira] [JBoss JIRA] (DROOLS-1547) Add tests to confirm that singleton lists can be treated as the element itself in filter results

Matteo Mortari (JIRA) issues at jboss.org
Thu May 11 10:16:00 EDT 2017


    [ https://issues.jboss.org/browse/DROOLS-1547?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13405225#comment-13405225 ] 

Matteo Mortari commented on DROOLS-1547:
----------------------------------------

The assignment in the cases of list-of-single-element treated assigned as the element itself, should already be covered by:

* originally here: https://github.com/kiegroup/drools/blob/master/kie-dmn/kie-dmn-core/src/main/java/org/kie/dmn/core/impl/DMNRuntimeImpl.java#L321-L326
* originally here: https://github.com/kiegroup/drools/blob/master/kie-dmn/kie-dmn-core/src/main/java/org/kie/dmn/core/ast/DMNContextEvaluator.java#L79-L84
* and as part of [DROOLS-1513]

PR will follow for the function invocation case.

> Add tests to confirm that singleton lists can be treated as the element itself in filter results
> ------------------------------------------------------------------------------------------------
>
>                 Key: DROOLS-1547
>                 URL: https://issues.jboss.org/browse/DROOLS-1547
>             Project: Drools
>          Issue Type: Task
>          Components: dmn engine
>    Affects Versions: 7.0.0.CR3
>            Reporter: Edson Tirelli
>            Assignee: Matteo Mortari
>             Fix For: 7.1.0.Final
>
>         Attachments: Ex_6_1.dmn
>
>
> The specification has a provision that singleton lists should be treated as the element itself in some cases, like filter results. I.e., in some cases, {{[a] = a}}.
> This is not completely consistent, but we need to handle it for some cases, like filter results. In other words, the following assignment should work fine, assuming {{a flight}} is a flight variable and {{flight list}} is a list of flights, and the filter returns a single result.
> {code}
> {
>   a flight : flight list[ number = "AC 531" ]
> }
> {code}
> We need to add tests to make sure it is working like that and fix it in case it is not.



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


More information about the jboss-jira mailing list