modeler.saveXML is not a function in bpmn.js react js

I have created BPMN diagram based on business needs using react js. Also am having save button to save the XML of created diagram. On clicking save button I want to get XML of created diagram.


 `<button onClick={getXmlFromModeler}>Save</button>`

function getXmlFromModeler(modeler) {
return new Promise((resolve, reject) => {
{format: true},
(err, xml) => {
if (err) {
} else {

but got an error

Uncaught (in promise) TypeError: modeler.saveXML is not a function

Any help would be appreciated

The error indicates that modeler is undefined or at least not what you expect it to be. Through debugging you should be able to resolve the issue.

1 Like