Skip to content

Lambda function returns null #1752

Open
apache/incubator-kie-drools
#6261
@yesamer

Description

@yesamer

TCK Test 0092-feel-lambda - 014

"compliance-level-3/0092-feel-lambda","0092-feel-lambda-test-01","014","ERROR","FAILURE: 'decision_014_1' expected='25.0' but found='null'"

Model: https://github.com/dmn-tck/tck/blob/a113546e37653dfc9e49284ead1ed49d43fe9d6e/TestCases/compliance-level-3/0092-feel-lambda/0092-feel-lambda.dmn#L487
Test: https://github.com/dmn-tck/tck/blob/a113546e37653dfc9e49284ead1ed49d43fe9d6e/TestCases/compliance-level-3/0092-feel-lambda/0092-feel-lambda-test-01.xml#L146

Double check why only one single test of this group fails

Consider this Decision node

<decision name="decision_014_1" id="_decision_014_1">
        <variable name="decision_014_1"/>
        <knowledgeRequirement>
            <requiredKnowledge href="#_bkm_014_1"/>
        </knowledgeRequirement>
        <!-- passed built-in functions as params  -->
        <literalExpression>
            <text>bkm_014_1(abs, sqrt)</text>
        </literalExpression>
    </decision>

It results in the following error:

14:13:47.511 [main] WARN org.kie.dmn.core.util.MsgUtil.logMessage:84 - Parameter 'fn1' is of type 'DMNType{ http://www.montera.com.au/spec/DMN/0092-feel-lambda : lambda_number_returns_number }' but the actual value 'org.kie.dmn.feel.runtime.functions.AbsFunction@7153995c' is not an instance of that type; setting as null
14:13:47.512 [main] WARN org.kie.dmn.core.util.MsgUtil.logMessage:84 - Parameter 'fn2' is of type 'DMNType{ http://www.montera.com.au/spec/DMN/0092-feel-lambda : lambda_number_returns_number }' but the actual value 'org.kie.dmn.feel.runtime.functions.SqrtFunction@3b256d50' is not an instance of that type; setting as null
14:13:47.512 [main] ERROR org.kie.dmn.core.util.MsgUtil.logMessage:83 - FEEL ERROR while evaluating literal expression 'fn1(-5)*fn2(25)': Not an invocable: 'null'
14:13:47.512 [main] ERROR org.kie.dmn.core.util.MsgUtil.logMessage:83 - FEEL ERROR while evaluating literal expression 'fn1(-5)*fn2(25)': Not an invocable: 'null'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:dmnRelated to DMNarea:engineRelated to the runtime enginestype:bugSomething is behaving unexpectedly

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions