I am using the modeler as a base tool and adding my own functionalities to it. Using the standard modeler.saveXML function, it’s already possible to download the XML model (which uses the xml variable). However, I am trying to convert the XML model to JSON before downloading it, so I need the XML file/text as a variable. How can I achieve this?
The xml variable gets its value with var xml = e.target.result; and I have tried to make that a global variable so I can use it elsewhere in my code, but that doesn’t work.
I am connecting my bpmn-js modeler to a service that analyses model elements. That service communicates using JSON files, so I need to convert the XML elements (element id’s, labels, sequence flows, etc) to be contained in a JSON file. So that file basically contains a list of elements with their id’s and labels.