bpmn-js 8.8.2 → 9.0.0-subprocesses.3

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.
Files changed (45) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/dist/assets/bpmn-js.css +79 -0
  3. package/dist/assets/diagram-js.css +82 -78
  4. package/dist/bpmn-modeler.development.js +929 -502
  5. package/dist/bpmn-modeler.production.min.js +7 -6
  6. package/dist/bpmn-navigated-viewer.development.js +20574 -19973
  7. package/dist/bpmn-navigated-viewer.production.min.js +22 -20
  8. package/dist/bpmn-viewer.development.js +19775 -19174
  9. package/dist/bpmn-viewer.production.min.js +22 -20
  10. package/lib/BaseViewer.js +0 -13
  11. package/lib/Viewer.js +3 -1
  12. package/lib/draw/BpmnRenderUtil.js +6 -4
  13. package/lib/features/context-pad/ContextPadProvider.js +1 -1
  14. package/lib/features/copy-paste/BpmnCopyPaste.js +13 -13
  15. package/lib/features/di-ordering/BpmnDiOrdering.js +2 -3
  16. package/lib/features/drilldown/DrilldownCentering.js +41 -0
  17. package/lib/features/drilldown/DrilldownOverlays.js +110 -0
  18. package/lib/features/drilldown/SubprocessCompatibility.js +193 -0
  19. package/lib/features/drilldown/index.js +14 -0
  20. package/lib/features/label-editing/LabelEditingPreview.js +3 -3
  21. package/lib/features/label-editing/cmd/UpdateLabelHandler.js +2 -1
  22. package/lib/features/modeling/BpmnFactory.js +8 -8
  23. package/lib/features/modeling/BpmnUpdater.js +35 -27
  24. package/lib/features/modeling/ElementFactory.js +60 -37
  25. package/lib/features/modeling/behavior/DataStoreBehavior.js +3 -1
  26. package/lib/features/modeling/behavior/IsHorizontalFix.js +7 -4
  27. package/lib/features/modeling/behavior/LabelBehavior.js +8 -7
  28. package/lib/features/modeling/behavior/ToggleElementCollapseBehaviour.js +6 -6
  29. package/lib/features/modeling/cmd/UpdateCanvasRootHandler.js +8 -6
  30. package/lib/features/modeling/cmd/UpdatePropertiesHandler.js +19 -12
  31. package/lib/features/modeling/cmd/UpdateSemanticParentHandler.js +5 -3
  32. package/lib/features/palette/PaletteProvider.js +3 -1
  33. package/lib/features/popup-menu/ReplaceMenuProvider.js +5 -5
  34. package/lib/features/popup-menu/util/TypeUtil.js +1 -1
  35. package/lib/features/replace/BpmnReplace.js +29 -29
  36. package/lib/import/BpmnImporter.js +27 -22
  37. package/lib/import/BpmnTreeWalker.js +19 -17
  38. package/lib/import/Importer.js +17 -6
  39. package/lib/util/CompatibilityUtil.js +21 -1
  40. package/lib/util/DiUtil.js +10 -3
  41. package/lib/util/LabelUtil.js +2 -3
  42. package/lib/util/ModelUtil.js +11 -0
  43. package/package.json +2 -2
  44. package/test/matchers/BoundsMatchers.js +10 -10
  45. package/test/matchers/ConnectionMatchers.js +5 -5
package/lib/BaseViewer.js CHANGED
@@ -528,19 +528,6 @@ BaseViewer.prototype.clear = function() {
528
528
  return;
529
529
  }
530
530
 
531
- // remove businessObject#di binding
532
- //
533
- // this is necessary, as we establish the bindings
534
- // in the BpmnTreeWalker (and assume none are given
535
- // on reimport)
536
- this.get('elementRegistry').forEach(function(element) {
537
- var bo = element.businessObject;
538
-
539
- if (bo && bo.di) {
540
- delete bo.di;
541
- }
542
- });
543
-
544
531
  // remove drawn elements
545
532
  Diagram.prototype.clear.call(this);
546
533
  };
package/lib/Viewer.js CHANGED
@@ -4,6 +4,7 @@ import CoreModule from './core';
4
4
  import TranslateModule from 'diagram-js/lib/i18n/translate';
5
5
  import SelectionModule from 'diagram-js/lib/features/selection';
6
6
  import OverlaysModule from 'diagram-js/lib/features/overlays';
7
+ import DrilldownModdule from './features/drilldown';
7
8
 
8
9
  import BaseViewer from './BaseViewer';
9
10
 
@@ -66,7 +67,8 @@ Viewer.prototype._modules = [
66
67
  CoreModule,
67
68
  TranslateModule,
68
69
  SelectionModule,
69
- OverlaysModule
70
+ OverlaysModule,
71
+ DrilldownModdule
70
72
  ];
71
73
 
72
74
  // default moddle extensions the viewer is composed of
@@ -3,10 +3,16 @@ import {
3
3
  some
4
4
  } from 'min-dash';
5
5
 
6
+ import {
7
+ getDi
8
+ } from '../util/ModelUtil';
9
+
6
10
  import {
7
11
  componentsToPath
8
12
  } from 'diagram-js/lib/util/RenderUtil';
9
13
 
14
+ // re-export getDi for compatibility
15
+ export { getDi };
10
16
 
11
17
  // element utils //////////////////////
12
18
 
@@ -42,10 +48,6 @@ export function isCollection(element) {
42
48
  return element.isCollection || (dataObject && dataObject.isCollection);
43
49
  }
44
50
 
45
- export function getDi(element) {
46
- return element.businessObject.di;
47
- }
48
-
49
51
  export function getSemantic(element) {
50
52
  return element.businessObject;
51
53
  }
@@ -197,7 +197,7 @@ ContextPadProvider.prototype.getContextPadEntries = function(element) {
197
197
  }
198
198
 
199
199
 
200
- if (isAny(businessObject, [ 'bpmn:Lane', 'bpmn:Participant' ]) && isExpanded(businessObject)) {
200
+ if (isAny(businessObject, [ 'bpmn:Lane', 'bpmn:Participant' ]) && isExpanded(element)) {
201
201
 
202
202
  var childLanes = getChildLanes(element);
203
203
 
@@ -1,5 +1,6 @@
1
1
  import {
2
2
  getBusinessObject,
3
+ getDi,
3
4
  is
4
5
  } from '../../util/ModelUtil';
5
6
 
@@ -45,23 +46,13 @@ export default function BpmnCopyPaste(bpmnFactory, eventBus, moddleCopy) {
45
46
  element = context.element;
46
47
 
47
48
  var businessObject = descriptor.oldBusinessObject = getBusinessObject(element);
49
+ var di = descriptor.oldDi = getDi(element);
48
50
 
49
51
  descriptor.type = element.type;
50
52
 
51
53
  copyProperties(businessObject, descriptor, 'name');
52
54
 
53
- descriptor.di = {};
54
-
55
- // colors will be set to DI
56
- copyProperties(businessObject.di, descriptor.di, [
57
- 'fill',
58
- 'stroke',
59
- 'background-color',
60
- 'border-color',
61
- 'color'
62
- ]);
63
-
64
- copyProperties(businessObject.di, descriptor, 'isExpanded');
55
+ copyProperties(di, descriptor, 'isExpanded');
65
56
 
66
57
  if (isLabel(descriptor)) {
67
58
  return descriptor;
@@ -135,11 +126,13 @@ export default function BpmnCopyPaste(bpmnFactory, eventBus, moddleCopy) {
135
126
  var cache = context.cache,
136
127
  descriptor = context.descriptor,
137
128
  oldBusinessObject = descriptor.oldBusinessObject,
138
- newBusinessObject;
129
+ oldDi = descriptor.oldDi,
130
+ newBusinessObject, newDi;
139
131
 
140
132
  // do NOT copy business object if external label
141
133
  if (isLabel(descriptor)) {
142
134
  descriptor.businessObject = getBusinessObject(cache[ descriptor.labelTarget ]);
135
+ descriptor.di = getDi(cache[ descriptor.labelTarget ]);
143
136
 
144
137
  return;
145
138
  }
@@ -151,6 +144,13 @@ export default function BpmnCopyPaste(bpmnFactory, eventBus, moddleCopy) {
151
144
  newBusinessObject
152
145
  );
153
146
 
147
+ newDi = bpmnFactory.create(oldDi.$type);
148
+
149
+ descriptor.di = moddleCopy.copyElement(
150
+ oldDi,
151
+ newDi
152
+ );
153
+
154
154
  // resolve references e.g. default sequence flow
155
155
  resolveReferences(descriptor, cache);
156
156
 
@@ -1,5 +1,4 @@
1
- import { getDi } from '../../draw/BpmnRenderUtil';
2
- import { getBusinessObject } from '../../util/ModelUtil';
1
+ import { getDi } from '../../util/ModelUtil';
3
2
 
4
3
  import {
5
4
  filter,
@@ -17,7 +16,7 @@ export default function BpmnDiOrdering(eventBus, canvas) {
17
16
 
18
17
  function orderDi() {
19
18
  var root = canvas.getRootElement(),
20
- rootDi = getBusinessObject(root).di,
19
+ rootDi = getDi(root),
21
20
  elements,
22
21
  diElements;
23
22
 
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Move collapsed subprocesses into view when drilling down. Zoom and scroll
3
+ * are saved in a session.
4
+ *
5
+ * @param {eventBus} eventBus
6
+ * @param {canvas} canvas
7
+ */
8
+ export default function DrilldownCentering(eventBus, canvas) {
9
+ var currentPlane = 'base';
10
+ var positionMap = {};
11
+
12
+ eventBus.on('plane.set', function(event) {
13
+ var currentViewbox = canvas.viewbox();
14
+ positionMap[currentPlane] = {
15
+ x: currentViewbox.x,
16
+ y: currentViewbox.y,
17
+ zoom: currentViewbox.scale
18
+ };
19
+
20
+ var planeId = event.plane.name;
21
+ var storedViewbox = positionMap[planeId] || { x: 0, y: 0, zoom: 1 };
22
+
23
+ var dx = (currentViewbox.x - storedViewbox.x) * currentViewbox.scale,
24
+ dy = (currentViewbox.y - storedViewbox.y) * currentViewbox.scale;
25
+
26
+ if (dx !== 0 || dy !== 0) {
27
+ canvas.scroll({
28
+ dx: dx,
29
+ dy: dy
30
+ });
31
+ }
32
+
33
+ if (storedViewbox.zoom !== currentViewbox.scale) {
34
+ canvas.zoom(storedViewbox.zoom, { x: 0, y: 0 });
35
+ }
36
+
37
+ currentPlane = planeId;
38
+ });
39
+ }
40
+
41
+ DrilldownCentering.$inject = [ 'eventBus', 'canvas' ];
@@ -0,0 +1,110 @@
1
+ import { domify, classes } from 'min-dom';
2
+
3
+ import { escapeHTML } from 'diagram-js/lib/util/EscapeUtil';
4
+ import { getBusinessObject, is } from '../../util/ModelUtil';
5
+
6
+ var ARROW_DOWN_SVG = '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4.81801948,3.50735931 L10.4996894,9.1896894 L10.5,4 L12,4 L12,12 L4,12 L4,10.5 L9.6896894,10.4996894 L3.75735931,4.56801948 C3.46446609,4.27512627 3.46446609,3.80025253 3.75735931,3.50735931 C4.05025253,3.21446609 4.52512627,3.21446609 4.81801948,3.50735931 Z"/></svg>';
7
+
8
+ var OPEN_CLASS = 'bjs-breadcrumbs-shown';
9
+
10
+ /**
11
+ * Adds Overlays that allow switching planes on collapsed subprocesses.
12
+ *
13
+ * @param {eventBus} eventBus
14
+ * @param {elementRegistry} elementRegistry
15
+ * @param {overlays} overlays
16
+ * @param {canvas} canvas
17
+ */
18
+ export default function DrilldownOverlays(eventBus, elementRegistry, overlays, canvas) {
19
+ var breadcrumbs = domify('<ul class="bjs-breadcrumbs"></ul>');
20
+ var container = canvas.getContainer();
21
+ var containerClasses = classes(container);
22
+ container.appendChild(breadcrumbs);
23
+
24
+ function updateBreadcrumbs(plane) {
25
+ var subProcess = elementRegistry.get(plane.name);
26
+ var parents = getParentChain(subProcess);
27
+
28
+ var path = parents.map(function(el) {
29
+ var title = escapeHTML(el.name || el.id);
30
+ var link = domify('<li><span class="bjs-crumb"><a title="' + title + '">' + title + '</a></span></li>');
31
+
32
+ link.addEventListener('click', function() {
33
+ if (canvas.getPlane(el.id)) {
34
+ canvas.setActivePlane(el.id);
35
+ } else {
36
+ var plane = canvas.findPlane(el.id);
37
+ canvas.setActivePlane(plane);
38
+ }
39
+ });
40
+
41
+ return link;
42
+ });
43
+
44
+ breadcrumbs.innerHTML = '';
45
+
46
+ // show breadcrumbs and expose state to .djs-container
47
+ var visible = path.length > 1;
48
+ containerClasses.toggle(OPEN_CLASS, visible);
49
+
50
+ path.forEach(function(el) {
51
+ breadcrumbs.appendChild(el);
52
+ });
53
+ }
54
+
55
+ eventBus.on('plane.set', function(event) {
56
+ var plane = event.plane;
57
+
58
+ updateBreadcrumbs(plane);
59
+ });
60
+
61
+ var createOverlay = function(element) {
62
+ var html = domify('<button class="bjs-drilldown">' + ARROW_DOWN_SVG + '</button>');
63
+
64
+ html.addEventListener('click', function() {
65
+ canvas.setActivePlane(element.id);
66
+ });
67
+
68
+ overlays.add(element, {
69
+ position: {
70
+ bottom: -7,
71
+ right: -8
72
+ },
73
+ html: html
74
+ });
75
+ };
76
+
77
+ var addOverlays = function(elements) {
78
+ elements.forEach(function(element) {
79
+ if (is(element, 'bpmn:SubProcess')
80
+ && element.collapsed
81
+ && canvas.getPlane(element.id)) {
82
+ createOverlay(element);
83
+ }
84
+ });
85
+ };
86
+
87
+ eventBus.on('import.done', function() {
88
+ addOverlays(elementRegistry.filter(function(el) {
89
+ return is(el, 'bpmn:SubProcess');
90
+ }));
91
+ });
92
+ }
93
+
94
+ DrilldownOverlays.$inject = [ 'eventBus', 'elementRegistry', 'overlays', 'canvas' ];
95
+
96
+
97
+ // helpers
98
+ var getParentChain = function(child) {
99
+ var bo = getBusinessObject(child);
100
+
101
+ var parents = [];
102
+
103
+ for (var element = bo; element; element = element.$parent) {
104
+ if (is(element, 'bpmn:SubProcess') || is(element, 'bpmn:Process')) {
105
+ parents.push(element);
106
+ }
107
+ }
108
+
109
+ return parents.reverse();
110
+ };
@@ -0,0 +1,193 @@
1
+
2
+ import { asBounds, asTRBL } from 'diagram-js/lib/layout/LayoutUtil';
3
+ import { is } from '../../util/ModelUtil';
4
+
5
+ var DEFAULT_POSITION = {
6
+ x: 180,
7
+ y: 160
8
+ };
9
+
10
+ /**
11
+ * Hook into `import.render.start` and create new planes for diagrams with
12
+ * collapsed subprocesses and all dis on the same plane.
13
+ *
14
+ * @param {eventBus} eventBus
15
+ * @param {moddle} moddle
16
+ */
17
+ export default function SubprocessCompatibility(eventBus, moddle) {
18
+ this._eventBus = eventBus;
19
+ this._moddle = moddle;
20
+
21
+ var self = this;
22
+
23
+ eventBus.on('import.render.start', 1500, function(e, context) {
24
+ self.handleImport(context.definitions);
25
+ });
26
+ }
27
+
28
+ SubprocessCompatibility.prototype.handleImport = function(definitions) {
29
+ if (!definitions.diagrams) {
30
+ return;
31
+ }
32
+
33
+ var self = this;
34
+ this._definitions = definitions;
35
+ this._processToDiagramMap = {};
36
+
37
+ definitions.diagrams.forEach(function(diagram) {
38
+ if (!diagram.plane || !diagram.plane.bpmnElement) {
39
+ return;
40
+ }
41
+
42
+ self._processToDiagramMap[diagram.plane.bpmnElement.id] = diagram;
43
+ });
44
+
45
+ var newDiagrams = [];
46
+ definitions.diagrams.forEach(function(diagram) {
47
+ var createdDiagrams = self.createNewDiagrams(diagram.plane);
48
+ Array.prototype.push.apply(newDiagrams, createdDiagrams);
49
+ });
50
+
51
+ newDiagrams.forEach(function(diagram) {
52
+ self.movePlaneElementsToOrigin(diagram.plane);
53
+ });
54
+ };
55
+
56
+
57
+ /**
58
+ * Moves all DI elements from collapsed subprocesses to a new plane.
59
+ *
60
+ * @param {Object} plane
61
+ * @return {Array} new diagrams created for the collapsed subprocesses
62
+ */
63
+ SubprocessCompatibility.prototype.createNewDiagrams = function(plane) {
64
+ var self = this;
65
+
66
+ var collapsedElements = [];
67
+ var elementsToMove = [];
68
+
69
+ plane.get('planeElement').forEach(function(diElement) {
70
+ var bo = diElement.bpmnElement;
71
+ var parent = bo.$parent;
72
+
73
+ if (is(bo, 'bpmn:SubProcess') && !diElement.isExpanded) {
74
+ collapsedElements.push(bo);
75
+ }
76
+
77
+ if (is(parent, 'bpmn:SubProcess') && parent !== plane.bpmnElement) {
78
+
79
+ // don't change the array while we iterate over it
80
+ elementsToMove.push({ diElement: diElement, parent: parent });
81
+ }
82
+ });
83
+
84
+ var newDiagrams = [];
85
+
86
+ elementsToMove.forEach(function(element) {
87
+ var diElement = element.diElement;
88
+ var parent = element.parent;
89
+
90
+ // parent is expanded, get nearest collapsed parent
91
+ while (parent && !collapsedElements.includes(parent)) {
92
+ parent = parent.$parent;
93
+ }
94
+
95
+ // false positive, all parents are expanded
96
+ if (!parent) {
97
+ return;
98
+ }
99
+
100
+ var diagram = self._processToDiagramMap[parent.id];
101
+ if (!diagram) {
102
+ diagram = self.createDiagram(parent);
103
+ self._processToDiagramMap[parent.id] = diagram;
104
+ newDiagrams.push(diagram);
105
+ }
106
+
107
+ self.moveToDiPlane(diElement, diagram.plane);
108
+ });
109
+
110
+ return newDiagrams;
111
+ };
112
+
113
+ SubprocessCompatibility.prototype.movePlaneElementsToOrigin = function(plane) {
114
+ var elements = plane.get('planeElement');
115
+
116
+ // get bounding box of all elements
117
+ var planeBounds = getPlaneBounds(plane);
118
+
119
+ var offset = {
120
+ x: planeBounds.x - DEFAULT_POSITION.x,
121
+ y: planeBounds.y - DEFAULT_POSITION.y
122
+ };
123
+
124
+ elements.forEach(function(diElement) {
125
+ if (diElement.waypoint) {
126
+ diElement.waypoint.forEach(function(waypoint) {
127
+ waypoint.x = waypoint.x - offset.x;
128
+ waypoint.y = waypoint.y - offset.y;
129
+ });
130
+ } else if (diElement.bounds) {
131
+ diElement.bounds.x = diElement.bounds.x - offset.x;
132
+ diElement.bounds.y = diElement.bounds.y - offset.y;
133
+ }
134
+ });
135
+ };
136
+
137
+
138
+ SubprocessCompatibility.prototype.moveToDiPlane = function(diElement, newPlane) {
139
+ var containingDiagram = findRootDiagram(diElement);
140
+
141
+ // remove DI from old Plane and add it to the new one
142
+ var parentPlaneElement = containingDiagram.plane.get('planeElement');
143
+ parentPlaneElement.splice(parentPlaneElement.indexOf(diElement), 1);
144
+ newPlane.get('planeElement').push(diElement);
145
+ };
146
+
147
+
148
+ SubprocessCompatibility.prototype.createDiagram = function(bo) {
149
+ var plane = this._moddle.create('bpmndi:BPMNPlane', { bpmnElement: bo });
150
+ var diagram = this._moddle.create('bpmndi:BPMNDiagram', {
151
+ plane: plane
152
+ });
153
+ plane.$parent = diagram;
154
+ plane.bpmnElement = bo;
155
+ diagram.$parent = this._definitions;
156
+ this._definitions.diagrams.push(diagram);
157
+ return diagram;
158
+ };
159
+
160
+ SubprocessCompatibility.$inject = [ 'eventBus', 'moddle' ];
161
+
162
+
163
+ // helpers
164
+
165
+ function findRootDiagram(element) {
166
+ if (is(element, 'bpmndi:BPMNDiagram')) {
167
+ return element;
168
+ } else {
169
+ return findRootDiagram(element.$parent);
170
+ }
171
+ }
172
+
173
+ function getPlaneBounds(plane) {
174
+ var planeTrbl = {
175
+ top: Infinity,
176
+ right: -Infinity,
177
+ bottom: -Infinity,
178
+ left: Infinity
179
+ };
180
+
181
+ plane.planeElement.forEach(function(element) {
182
+ if (!element.bounds) {
183
+ return;
184
+ }
185
+
186
+ var trbl = asTRBL(element.bounds);
187
+
188
+ planeTrbl.top = Math.min(trbl.top, planeTrbl.top);
189
+ planeTrbl.left = Math.min(trbl.left, planeTrbl.left);
190
+ });
191
+
192
+ return asBounds(planeTrbl);
193
+ }
@@ -0,0 +1,14 @@
1
+ import OverlaysModule from 'diagram-js/lib/features/overlays';
2
+ import ChangeSupportModule from 'diagram-js/lib/features/change-support';
3
+
4
+ import DrilldownOverlays from './DrilldownOverlays';
5
+ import DrilldownCentering from './DrilldownCentering';
6
+ import SubprocessCompatibility from './SubprocessCompatibility';
7
+
8
+ export default {
9
+ __depends__: [ OverlaysModule, ChangeSupportModule ],
10
+ __init__: [ 'drilldownOverlays', 'drilldownCentering', 'subprocessCompatibility'],
11
+ drilldownOverlays: [ 'type', DrilldownOverlays ],
12
+ drilldownCentering: [ 'type', DrilldownCentering ],
13
+ subprocessCompatibility: [ 'type', SubprocessCompatibility ]
14
+ };
@@ -6,7 +6,7 @@ import {
6
6
  } from 'tiny-svg';
7
7
 
8
8
  import {
9
- getBusinessObject,
9
+ getDi,
10
10
  is
11
11
  } from '../../util/ModelUtil';
12
12
 
@@ -132,7 +132,7 @@ LabelEditingPreview.$inject = [
132
132
  // helpers ///////////////////
133
133
 
134
134
  function getStrokeColor(element, defaultColor) {
135
- var bo = getBusinessObject(element);
135
+ var di = getDi(element);
136
136
 
137
- return bo.di.get('stroke') || defaultColor || 'black';
137
+ return di.get('stroke') || defaultColor || 'black';
138
138
  }
@@ -67,7 +67,8 @@ export default function UpdateLabelHandler(modeling, textRenderer) {
67
67
 
68
68
  modeling.createLabel(element, labelCenter, {
69
69
  id: businessObject.id + '_label',
70
- businessObject: businessObject
70
+ businessObject: businessObject,
71
+ di: element.di
71
72
  });
72
73
  }
73
74
  }
@@ -83,11 +83,10 @@ BpmnFactory.prototype.createDiLabel = function() {
83
83
  };
84
84
 
85
85
 
86
- BpmnFactory.prototype.createDiShape = function(semantic, bounds, attrs) {
87
-
86
+ BpmnFactory.prototype.createDiShape = function(semantic, attrs) {
88
87
  return this.create('bpmndi:BPMNShape', assign({
89
88
  bpmnElement: semantic,
90
- bounds: this.createDiBounds(bounds)
89
+ bounds: this.createDiBounds()
91
90
  }, attrs));
92
91
  };
93
92
 
@@ -110,14 +109,15 @@ BpmnFactory.prototype.createDiWaypoint = function(point) {
110
109
  };
111
110
 
112
111
 
113
- BpmnFactory.prototype.createDiEdge = function(semantic, waypoints, attrs) {
112
+ BpmnFactory.prototype.createDiEdge = function(semantic, attrs) {
114
113
  return this.create('bpmndi:BPMNEdge', assign({
115
- bpmnElement: semantic
114
+ bpmnElement: semantic,
115
+ waypoints: this.createDiWaypoints([])
116
116
  }, attrs));
117
117
  };
118
118
 
119
- BpmnFactory.prototype.createDiPlane = function(semantic) {
120
- return this.create('bpmndi:BPMNPlane', {
119
+ BpmnFactory.prototype.createDiPlane = function(semantic, attrs) {
120
+ return this.create('bpmndi:BPMNPlane', assign({
121
121
  bpmnElement: semantic
122
- });
122
+ }, attrs));
123
123
  };