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

DefaultXmlFormatter: Should return plain text if formatting fails

XMLWordPrintable

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

      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

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

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

                Created:
                Updated:
                Resolved: