camunda/camunda-bpmn-moddle

CallActivity, CalledElement infinite serialize to QName _x005F_

VGamezz19 opened this issue · 5 comments

Describe the Bug

Hey there! First of all, tnx for your time.

Im facing an issue while trying to add a complex name in the CalledElement on CallActivity section panel.

After doing a saveXML({}) the string from CalledElement itsself converted as a QName.

The problem is that it continuing to convert as a QName when he already is.

Steps to Reproduce

We are doing a tipical form page with the BPMN Modeler and bpmn-js-properties-panel + camunda-bpmn-moddle, without no custom parameters, just with the initial README.md config steps.

When form submit, we execute modeler.saveXML({ format: true });, and keep in our BBDD the XML.
When we reload the page, we fill the Modeler with the XML saved in our BBDD.

  • 1
    Fill Called Element with some spaces

img

and then, execute modeler.saveXML({ format: true });

  • 2

Reload the page and fill Modeler with the last XML. We can see that Called Element has serialize itself

img

Then, execute modeler.saveXML({ format: true }); without no changes.

  • 3

Reload the page and fill Modeler with the last XML. We can see that Called Element has serialize itself AGAIN

img

Then, execute modeler.saveXML({ format: true }); without no changes.

  • 4

Reload the page and fill Modeler with the last XML. We can see that Called Element has serialize itself f AGAIN

img

Expected Behavior

It should not serilize _ to unicode

Environment

Please complete the following information:

  • Browser: Chrome Version 89.0.4389.128 (Official Build) (64-bit)
  • OS: Windows 10
  • Library version:
    • "bpmn-js": "^8.2.0",
    • "bpmn-js-properties-panel": "^0.42.0",
    • "camunda-bpmn-moddle": "^5.0.0",

Are you creating an extension or is this a general behavior when working with this module? Could you maybe share a Code Snippet / or a CodeSandbox which reproduces the behavior you are referring to?

I recently added some issue templates that were missing in this project. Could you maybe take one (feature request or bug report) and provide the necessary details? It will help us to understand your problem in a detailed manner.

Hey @pinussilvestrus! i did update the issue with your template.

However, Its dificult to me replicate an example in the CodeSandbox.

I added more information about the issue in Steps to Reproduce setcion, hope it could helps to you to understand!.

Really glad for your time

I was trying to reproduce it inside this CodeSandbox (all libraries on the latest version). When I click the button and execute the saving of the XML, I don't experience the side effect you mention.

Can you maybe try to reproduce your behavior with the sandbox? Maybe it also relates to your personal setup.

Hi @pinussilvestrus first of all, thanks for your time.
I'm ashamed to said that we have discovered the problem. It comes from our .NetCore API.

There we are working with System.Xml.XmlSerializer, Version=4.1.2.0 just to work with the BPMN properties inside our API domain. We figured out that this XmlSerializer is adding their own validations and parsers while formating de BPMNxml to object

        /// <summary>
        /// Parse BPMN
        /// </summary>
        /// <param name="stream">BPMN XML stream</param>
        /// <returns>Parsed definitions element</returns>
        public static tDefinitions Parse(System.IO.Stream stream)
        {
            var serialzer = new XmlSerializer(typeof(tDefinitions));
            return (tDefinitions)serialzer.Deserialize(stream);
        }

Following this work around

If you have more info about how to parse the BPMN xml in .Net Core, let me know, otherwise, close the issue!

Tnx alot for your time

Great to hear you found the problem :)

I'll close the issue. Follow-up discussions can be made in the Camunda forum I guess.