Hello,
I have difficulties exporting the xml text of a modeler.
My code is :
let bpmnXML = '...'
This is a sample xml text.
let modeler = new BpmnJS({ container: '#canvas'});
modeler.importXML(bpmnXML, function(err) { if (!err) { var canvas = modeler.get('canvas'); canvas.zoom('fit-viewport'); } return false; });
The diagram is well displayed in the modeler. Then I draw a few more shapes and I would like to get the updated XML as a string.
I have tried the following :
modeler.saveXML({ format: true }, function(err, updatedXML) { if (!err){ console.log(updatedXML); } return false; });
But it return the error : Error: no definitions loaded
Does anyone know what I am doing wrong ?
Thanks a lot
Thomas