bpmn-js 3.4.0 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * bpmn-js - bpmn-navigated-viewer v3.4.0
2
+ * bpmn-js - bpmn-navigated-viewer v3.5.0
3
3
  *
4
4
  * Copyright (c) 2014-present, camunda Services GmbH
5
5
  *
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * Source Code: https://github.com/bpmn-io/bpmn-js
10
10
  *
11
- * Date: 2019-04-25
11
+ * Date: 2019-06-28
12
12
  */
13
13
  (function (global, factory) {
14
14
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -18378,9 +18378,7 @@
18378
18378
  return done(err, parseWarnings);
18379
18379
  }
18380
18380
 
18381
- self._setDefinitions(definitions);
18382
-
18383
- self.open(bpmnDiagram, function(err, importWarnings) {
18381
+ self.importDefinitions(definitions, bpmnDiagram, function(err, importWarnings) {
18384
18382
  var allWarnings = [].concat(parseWarnings, importWarnings || []);
18385
18383
 
18386
18384
  self._emit('import.done', { error: err, warnings: allWarnings });
@@ -18390,6 +18388,40 @@
18390
18388
  });
18391
18389
  };
18392
18390
 
18391
+ /**
18392
+ * Import parsed definitions and render a BPMN 2.0 diagram.
18393
+ *
18394
+ * Once finished the viewer reports back the result to the
18395
+ * provided callback function with (err, warnings).
18396
+ *
18397
+ * ## Life-Cycle Events
18398
+ *
18399
+ * During import the viewer will fire life-cycle events:
18400
+ *
18401
+ * * import.render.start (graphical import start)
18402
+ * * import.render.complete (graphical import finished)
18403
+ *
18404
+ * You can use these events to hook into the life-cycle.
18405
+ *
18406
+ * @param {ModdleElement<Definitions>} definitions parsed BPMN 2.0 definitions
18407
+ * @param {ModdleElement<BPMNDiagram>|String} [bpmnDiagram] BPMN diagram or id of diagram to render (if not provided, the first one will be rendered)
18408
+ * @param {Function} [done] invoked with (err, warnings=[])
18409
+ */
18410
+ Viewer.prototype.importDefinitions = function(definitions, bpmnDiagram, done) {
18411
+
18412
+ if (isFunction(bpmnDiagram)) {
18413
+ done = bpmnDiagram;
18414
+ bpmnDiagram = null;
18415
+ }
18416
+
18417
+ // done is optional
18418
+ done = done || function() {};
18419
+
18420
+ this._setDefinitions(definitions);
18421
+
18422
+ return this.open(bpmnDiagram, done);
18423
+ };
18424
+
18393
18425
  /**
18394
18426
  * Open diagram of previously imported XML.
18395
18427
  *