Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-4744

If I provide neither name nor id, an empty id is serialized

    • Icon: Bug Report Bug Report
    • Resolution: Fixed
    • Icon: L3 - Default L3 - Default
    • 7.4.0, 7.4.0-alpha3
    • None
    • dmn-ui
    • None

      Problem:

      • Given that I provide neither a name nor an id, an empty id is serialized for the dmn table.

      Proposed solution:

      • constant id ("the-decision")

        This is the controller panel for Smart Panels app

            [CAM-4744] If I provide neither name nor id, an empty id is serialized

            If I interpret the ticket correctly, the problem is, that when creating a new table in the dmn demo, that I can download the table without providing the id.

            It is actually not possible to remove the id once set (you can change it though), see CAM-4322

            Therefore, I fixed it by setting a standard id in the empty table seed: https://github.com/dmn-io/dmn-js-examples/commit/6bdad8c65dd51f4c343dbdb4bbeb5f38a3ac8338

            Sebastian Stamm added a comment - If I interpret the ticket correctly, the problem is, that when creating a new table in the dmn demo, that I can download the table without providing the id. It is actually not possible to remove the id once set (you can change it though), see CAM-4322 Therefore, I fixed it by setting a standard id in the empty table seed: https://github.com/dmn-io/dmn-js-examples/commit/6bdad8c65dd51f4c343dbdb4bbeb5f38a3ac8338

            Daniel Meyer added a comment -

            Yes, the problem was that an empty id="" attribute was serialized. That is not valid xml and won't parse... (AFAIK)

            Daniel Meyer added a comment - Yes, the problem was that an empty id="" attribute was serialized. That is not valid xml and won't parse... (AFAIK)

            What should happen when I import a table without id and name? Should the dmn modeler repair the table?

            Michael Schoettes added a comment - What should happen when I import a table without id and name? Should the dmn modeler repair the table?

            Daniel Meyer added a comment -

            Import:
            If repairing is easy, then we should repair.
            Alternative: reject import of the model with comprehensive error message

            Export:
            All models exported by the the editor should have valid ids.

            Daniel Meyer added a comment - Import: If repairing is easy, then we should repair. Alternative: reject import of the model with comprehensive error message Export: All models exported by the the editor should have valid ids.

            Repairing should be easy, but I am not sure if we should do it.

            If the user uses only our dmn modeler, his dmn files will always have an id. So if a user imports a dmn file without this id, there is most likely a reason for that. Either the dmn file comes from another modeling tool that does not support ids and will possibly break if an id is provided. Or the user deliberately deleted the id. In both cases it may not be expected by the user, that an id magically appears.

            My proposal: Accept the import without an id, display the table without the id, but present a warning message to the user that this is not valid xml.

            Sebastian Stamm added a comment - Repairing should be easy, but I am not sure if we should do it. If the user uses only our dmn modeler, his dmn files will always have an id. So if a user imports a dmn file without this id, there is most likely a reason for that. Either the dmn file comes from another modeling tool that does not support ids and will possibly break if an id is provided. Or the user deliberately deleted the id. In both cases it may not be expected by the user, that an id magically appears. My proposal: Accept the import without an id, display the table without the id, but present a warning message to the user that this is not valid xml.

            We should make sure that we only export valid xml. That means:

            We import tables with the id attribute missing. If the user does not enter an id, the attribute stays missing.
            We should repair tables where the id attribute is set to empty string when importing them.

            Sebastian Stamm added a comment - We should make sure that we only export valid xml. That means: We import tables with the id attribute missing. If the user does not enter an id, the attribute stays missing. We should repair tables where the id attribute is set to empty string when importing them.

            Sebastian Stamm added a comment - commit: https://github.com/bpmn-io/dmn-js/commit/a83785e0da1fb0dfffe292622e109c5871ef55f4

              michael.schoettes Michael Schoettes
              meyer Daniel Meyer
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: