apache / incubator-kie-issues

Apache License 2.0
12 stars 1 forks source link

KIE Sandbox: Resizing columns of `Loan Pre-qualification` Decision Table on `Sample.dmn` is breaking the model parsing #1374

Closed tiagobento closed 2 months ago

tiagobento commented 3 months ago

Steps to reproduce:

  1. Run online-editor (KIE Sandbox) from on main branch.
  2. Open it on Chrome and click on "Try sample" on the DMN card at the Home page.
  3. Hover over the Loan Pre-Qualification Decision and click on Edit.
  4. Resize one of the columns of the Decision Table.
  5. Refresh the page.

You'll see a blank screen, with an error on the console: Error: Stopping NaN from propagating. Tried to parse from (float) ''

image

Goals of this task:

  1. Fix the bug by sending a PR to the main branch of kie-tools.
  2. Try to find a workaround to recover from the error without the fix.
  3. Understand what is the exact problem and provide an assessment of the DMN models that might be impacted.
kbowers-ibm commented 2 months ago
  1. Fix the bug by sending a PR to the main branch of kie-tools.
    • WIP, will most likely involve updating the updateExpressionWidths.tsx and boxedExpressionScreen.tsx files to set a default value when the <kie:width> tag doesn't exist.
  2. Try to find a workaround to recover from the error without the fix:

    1. Navigate to the affected file and download it (Share -> Download Current File)
    2. Open the downloaded file with a text editor
    3. You should see kie:width tags with empty values, e.g.:
      <kie:ComponentWidths dmnElementRef="_EF7F404A-939E-4889-95D8-E4053DD1EED9">
      <kie:width />
      <kie:width />
      <kie:width />
      <kie:width />
      <kie:width />
      <kie:width>106</kie:width>
      </kie:ComponentWidths>

    iv. Give all the kie:width tags a value, e.g.:

<kie:ComponentWidths dmnElementRef="_EF7F404A-939E-4889-95D8-E4053DD1EED9">
    <kie:width>106</kie:width>
    <kie:width>106</kie:width>
    <kie:width>106</kie:width>
    <kie:width>106</kie:width>
    <kie:width>106</kie:width>
    <kie:width>106</kie:width>
</kie:ComponentWidths>

v. Upload the updated file and the editor should now load properly.

  1. Understand what is the exact problem and provide an assessment of the DMN models that might be impacted.
    • This seems to only affect files that already have a decision table defined, but don't have the kie:ComponentWidths tag defined with relevant <kie:width> tags, e.g. the sample.dmn or drawing1-4.dmn.
    • When you create a Decision Table using the classic or new DMN it populates the kie:widths automatically, e.g.
      <kie:ComponentsWidthsExtension>
      <kie:ComponentWidths dmnElementRef="_AD31A7E4-7C60-48EC-8D69-A9CAD9E57B82">
      <kie:width>60</kie:width>
      <kie:width>118</kie:width>
      <kie:width>118</kie:width>
      <kie:width>240</kie:width>
      </kie:ComponentWidths>
      </kie:ComponentsWidthsExtension>
    • This isn't the case in these older files, e.g. the drawing-1-4.dmn contains a decision table but no <kie:width> tags.
      <di:extension>
      <kie:ComponentsWidthsExtension>
      <kie:ComponentWidths dmnElementRef="_181ebf70-8dd9-4ca2-9c4b-3410f9fab748"/>
      </kie:ComponentsWidthsExtension>
      </di:extension>
kbowers-ibm commented 2 months ago

Closed by https://github.com/apache/incubator-kie-tools/pull/2458