Modifying the saving

Hi everyone,

As I’m trying to customize the Camunda Modeler, I ended up working on the saving of a BPMN model.

My custom model contains new elements as well as an associated meta-model. Going through the forum I found out that I can’t save my custom elements in the *.bpmn files (Maybe I’m wrong?). As a workaround, I want to save the custom elements in a file next to the *.bmpn file. My modeler now contains a custom saveXML method but I can’t figure out were the file path is created and then used to write the *.bpmn files.

Can any help me to find where in the code I need to put my hands on? :slight_smile:

Here’s my custom saveXML method if it helps:

/**
 * Export the currently displayed BPMN 2.0 diagram as
 * a BPMN 2.0 XML document.
 *
 * In addition to the default saveXML method defined
 * in the bpmn-js/Modeler class, this method allows
 * custom elements to be saved as well.
 *
 * @param {Object} [options] export options
 * @param {Boolean} [options.format=false] output formated XML
 * @param {Boolean} [options.preamble=true] output preamble
 *
 * @param {Function} done invoked with (err, xml)
 */
IdsmModeler.prototype.saveXML = function(options, done) {
  // First, we save the default content...
  Modeler.prototype.saveXML.call(this, options, done);

  // Then, we save the custom content (in a seperate file?)

  // TODO: Add the saving mechanism for the custom elements.
};