Uploaded image for project: 'Kogito'
  1. Kogito
  2. KOGITO-1429

DefaultXmlFormatter: Should return plain text if formatting fails

    XMLWordPrintable

Details

      • Run the DMN editor.
      • Open an invalid model (see attached).
      • Save it.
      • Open the saved file in a text editor.

    Description

      DefaultXmlFormatter attempts to format the text returned from editors assuming it is a String representation of an XML document. However both DMN and BPMN editors allow saving invalid content i.e. plain text not being the representation of a valid XML document (in which scenarios both DMN and BPMN would have shown the ACE editor to Users). Consequentially calls to editor.getContent() may return a Promise that does not contain a String representation of an XML document. Passing this to the DefaultXmlFormatter leads to an error that is stored in the file.

      Revealed during other PR review, see the comment

      Attachments

        1. broken (copy).dmn
          0.5 kB
        2. KOGITO-1429-getContent result.png
          KOGITO-1429-getContent result.png
          114 kB
        3. KOGITO-1429-invalid content.png
          KOGITO-1429-invalid content.png
          107 kB
        4. Screenshot from 2021-01-12 15-16-52.png
          Screenshot from 2021-01-12 15-16-52.png
          145 kB
        5. test.dmn
          0.0 kB

        Activity

          Public project attachment banner

            context keys: [headless, issue, helper, isAsynchronousRequest, project, action, user]
            current Project key: KOGITO

            People

              tfernand-1 Tiago Bento
              manstis@redhat.com Michael Anstis
              Jozef Marko Jozef Marko
              Jozef Marko Jozef Marko
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: