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

Empty name and typeref Attributes Persist in XML for Single Output Decision Table #936

Open
BiancaBode opened this issue Feb 12, 2025 · 2 comments
Labels
backlog Queued in backlog bug Something isn't working Decision Table DMN support spring cleaning Could be cleaned up one day

Comments

@BiancaBode
Copy link

Description

According to the DMN 1.3 specification, when a single output decision table is used, the name and typeref attributes should not be present in the XML representation of the DMN model. However, in dmn-js, when we remove the name and type reference from the decision table output column in the editor, the resulting XML still contains empty name and typeref attributes in the <output> element.

This leads to validation issues because Drools interprets these empty attributes as still being explicitly set, which is non-compliant with the DMN 1.3 specification.

Steps to Reproduce

  1. Open dmn-js and create a decision table with a single output.
  2. Remove the name and typeref from the output column.
  3. Export the DMN XML and inspect the <output> element.
  4. Observe that <output name="" typeref="" /> still appears in the XML.
  5. Run against Drools validation – it fails because the attributes are still present.

Expected Behavior

  • When the name and typeref fields are removed from the editor, they should not appear in the exported XML at all.

Actual Behavior

  • Even after removing these fields in the editor, they remain in the XML as empty attributes (name="" typeref=""), causing validation errors in Drools.

Environment

  • dmn-js version: v.17.0.3
  • Browser: Edge
  • OS: Windows
@BiancaBode BiancaBode added the bug Something isn't working label Feb 12, 2025
@barmac
Copy link
Member

barmac commented Feb 13, 2025

I cannot reproduce the part of the issue regarding a single name. If I remove the name from an output, it is not present in the XML.

Screen.Recording.2025-02-13.at.15.01.04.mov

There is of course a question whether the output should preserve its name when it becomes the only one in the decision table, but that could go against the editing flow when the user models one output after another. We could also consider cleanup at the export, but that may go against the no surprises principle. I'd rather use linting for such cases.

Regarding typeRef, it should be removed when it's erased but isn't.

Image

@barmac barmac added Decision Table DMN support backlog Queued in backlog spring cleaning Could be cleaned up one day labels Feb 13, 2025
@barmac
Copy link
Member

barmac commented Feb 13, 2025

So my assessment is that for dmn-js we need to fix empty typeref, but not for a single output, but rather all outputs.
On top of that, a dmn linter could report problems as we do in bpmn-js ecosystem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Queued in backlog bug Something isn't working Decision Table DMN support spring cleaning Could be cleaned up one day
Projects
None yet
Development

No branches or pull requests

2 participants