Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify FEEL null handling in PathExpression #537

Closed
nikku opened this issue Jan 16, 2023 · 1 comment
Closed

Clarify FEEL null handling in PathExpression #537

nikku opened this issue Jan 16, 2023 · 1 comment

Comments

@nikku
Copy link
Contributor

nikku commented Jan 16, 2023

Describe the context

The DMN 1.4 specification gives users some pointers on how FEEL should handle invalid inputs and data formats (cf. additional context). From what it reads to me the way is null cohersion. Invalid (incompatible operations, access, or invocations) yield null. That intention is not explicitly expressed though (you need to read between the lines, interpret what is actually specified.

null cohersion around PathExpression is not clearly specified and may lead to engines behaving slightly different:

// given
context = {
  a: {
    b: 3
  }
}

// when
c = context.a.c

Expected Behavior

// then (?)
c = null

// but also transitive (?)
c.foo = null

// also works with `get value` (?)
get value(a, "c") = null

Alternative Interpretations

To be clear there exists a number of different possible interpretations:

strict null handling, blowing up

c is not present on context `{ b }`

Additional Context

I'm aware of the following cases of null cohersion, explicitly defined by the spec:

Access function with wrong arguments

date(1, 2, 3, 4, 5, 6) = null

Unboxing of single value lists

["a"] + "a" = "aa"

Related to #536

@nikku
Copy link
Contributor Author

nikku commented Jan 18, 2023

This seems to be clarified by @barmac in #536 (comment):

{ b: 1 }.a < 3

// which is equal to
null < 3

What is missing is TCK test cases to clearly document the behavior.

nikku added a commit to camunda/dmn-tck that referenced this issue Jan 19, 2023
Ensures the following is true:

```
{ a: 1 }.b = null
```

Related to dmn-tck#537
nikku added a commit to camunda/dmn-tck that referenced this issue Jan 19, 2023
Ensures the following is true:

```
{ a: 1 }.b = null
```

Related to dmn-tck#537
nikku added a commit to camunda/dmn-tck that referenced this issue Jan 19, 2023
Ensures the following is true:

```
{ a: 1 }.b = null
```

Related to dmn-tck#537
nikku added a commit to camunda/dmn-tck that referenced this issue May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant