bpmn js - export svg to bpmn xml

903 views Asked by At

I have tried multiple ways to export the svg from the modeler to a bpmn xml, but unable to export. I tried following ways

  1. modeler.moddle.toXML(modeler.get('canvas'), { format: true }, function (err, updatedXML) { console.log(updatedXML); });

  2. modeler.saveXML({ format:true },function(err,output){ if(err){ console.log(err); } else{ console.log(output); } });

  3. cli.save('bpmn'); - It works on the browser console.

I always get these: undefined or no definitions loaded.

Please help.

1

There are 1 answers

0
Shri D On BEST ANSWER

Well,

The main problem was my thinking. As I come from a background of PHP type languages that are synchronous; so even though I read about the mean stacks asynchronous nature, I wasn't applying it.

Later I applied the same code and it worked.