src/main/webapp/js/plugins/bower_components/bpmn-js/dist/bpmn-viewer.js
/**
 * Import the definitions into a diagram.
 *
 * Errors and warnings are reported through the specified callback.
 *
 * @param  {Diagram} diagram
 * @param  {ModdleElement} definitions
 * @param  {Function} done the callback, invoked with (err, [ warning ]) once the import is done
 */
Import the definitions into a diagram.
Errors and warnings are reported through the specified callback.

@param  {Diagram} diagram
@param  {ModdleElement} definitions
@param  {Function} done the callback, invoked with (err, [ warning ]) once the import is done
Import the definitions into a diagram . Errors and warnings are reported through the specified callback . @param { Diagram } diagram @param { ModdleElement } definitions @param { Function } done the callback invoked with ( err [ warning ] ) once the import is done
function importBpmnDiagram(diagram, definitions, done) {
  var importer = diagram.get('bpmnImporter'),
      eventBus = diagram.get('eventBus'),
      translate = diagram.get('translate');
  var error,
      warnings = [];
  function render(definitions) {
    var visitor = {
      root: function(element) {
        return importer.add(element);
      },
      element: function(element, parentShape) {
        return importer.add(element, parentShape);
      },
      error: function(message, context) {
        warnings.push({ message: message, context: context });
      }
    };
    var walker = new BpmnTreeWalker(visitor, translate);
    walker.handleDefinitions(definitions);
  }
  eventBus.fire('import.render.start', { definitions: definitions });
  try {
    render(definitions);
  } catch (e) {
    error = e;
  }
  eventBus.fire('import.render.complete', {
    error: error,
    warnings: warnings
  });
  done(error, warnings);
}
function importBpmnDiagram ( diagram , definitions , done ) { var importer = diagram . get ( 'bpmnImporter' ) , eventBus = diagram . get ( 'eventBus' ) , translate = diagram . get ( 'translate' ) ; var error , warnings = [ ] ; function render ( definitions ) { var visitor = { root : function ( element ) { return importer . add ( element ) ; } , element : function ( element , parentShape ) { return importer . add ( element , parentShape ) ; } , error : function ( message , context ) { warnings . push ( { message : message , context : context } ) ; } } ; var walker = new BpmnTreeWalker ( visitor , translate ) ; walker . handleDefinitions ( definitions ) ; } eventBus . fire ( 'import.render.start' , { definitions : definitions } ) ; try { render ( definitions ) ; } catch ( e ) { error = e ; } eventBus . fire ( 'import.render.complete' , { error : error , warnings : warnings } ) ; done ( error , warnings ) ; }
Import the definitions into a diagram.
Import the definitions into a diagram .
/**
   * Walk the diagram semantically, importing (=drawing)
   * all elements you encounter.
   *
   * @param {ModdleElement} definitions
   */ // traverse BPMN 2.0 document model, // starting at definitions