apache / incubator-kie-issues

Apache License 2.0
12 stars 1 forks source link

DMN Runner table nested types notation is different than DMN boxed expression editor notation #265

Open jomarko opened 1 year ago

jomarko commented 1 year ago

This issue can be spot when working with DMN Runner tabular view and the input data column definitions are structured data types.

In such scenario DMN boxed expression editor uses . notation do delimit structure levels, while DMN Runner table uses - notation to delimit structure levels.

See the screenshot below. Screenshot 2023-05-17 140959

Steps to reproduce

  1. open https://sandbox.kie.org/ and setup kie extended services to be able to run DMN models
  2. import DMN file (remove .txt extension before importing): PlanetDataType.dmn.txt
  3. import DMN file into same oflder as previous one, again remove .txt extension: Lab01.dmn.txt
  4. Start DMN Runner table
jomarko commented 1 year ago

During reporting #265, another issues was spotted that is related also to DMN Runner table. The problem is in resizing output columns. Output columns width is reset with each input columns value change.

Steps to reproduce

  1. Start with steps from #265
  2. Fill in DMN inputs with some data and resize the 'Habitability' output column, like [1]
  3. Then change some input column value, the output column width change will be lost [2]

[1] Screenshot 2023-05-17 142448

[2] Screenshot 2023-05-17 142823

ljmotta commented 1 year ago

We already have an issue to improve the separator (#175) but I unifying the experience would be a great idea. I'll close the #175 in favour of this one.

ljmotta commented 1 year ago

One thing to be aware of, is using a . separator will break the DMN Runner out of the box as it uses the uniforms library which uses object paths to build the Form and Table.

The DMN model is mapped to a JSON Schema, and the form is built from it. So if we have a input node with a . and we use it as a separator, we will not know if its a property of the field or if it's the field.

Example. An object like this:

{
  "my": { "input": 1 }
}

The object path "my.input" will retrieve the value 1.

An object that uses "." in the name e.g.: "my.input":

{
  "my.input": 1,
}

The object path "my.input" will retrieve the value 1 too.

So it's not possible to know if it's the entire name of a object property or if it's the "object" path:

{
  "my.input": 1,
  "my": { "input": 2 }
}

The object path "my.input" will also retrieve the value 1.

So it will require to check how the table and form are built. Also it would good to add a visual separator for the field name in the table. An example of the field name "my.input" with a Structure Data Type that contains "name":

"my.input.name" instead of "my.input.name"