I have a modeler page and I have my index.js file for the script and when i try to save a created bpmn file I Added a save button like this :
Save
I want to use this saveBPMN function when i click my save button
async function customSaveBPMN() {
window.showProgressLoading();
try {
const { xml } = await customBpmnModeler.saveXML({ format: true });
const blob = new Blob([xml], { type: "text/xml" });
const file = new File([blob], getFileName());
const data = new FormData();
data.append("File", file);
data.append("itemType", "11");
data.append("FamilyId", "17");
const url = getUrl();
const res = await request(url, { type: "POST", contentType: false, processData: false, data });
showMessage(res.Message, res.Status === -1 ? "error" : "success");
setTimeout(() => {
location.href = "/SomeRouting";
}, 1000);
} catch (err) {
console.log(err);
showMessage(err.message, "error");
} finally {
window.hideProgressLoading();
}
}
and when i clicked my button I think bpmn-js library create another index.js file and run another function