bpmn-js 17.4.0 → 17.6.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.
- package/dist/bpmn-modeler.development.js +167 -154
- package/dist/bpmn-modeler.production.min.js +7 -7
- package/dist/bpmn-navigated-viewer.development.js +108 -85
- package/dist/bpmn-navigated-viewer.production.min.js +4 -4
- package/dist/bpmn-viewer.development.js +104 -85
- package/dist/bpmn-viewer.production.min.js +4 -4
- package/lib/BaseModeler.d.ts +5 -2
- package/lib/BaseModeler.js +5 -1
- package/lib/BaseViewer.d.ts +81 -9
- package/lib/BaseViewer.js +47 -3
- package/lib/Modeler.d.ts +4 -2
- package/lib/Modeler.js +4 -1
- package/lib/NavigatedViewer.d.ts +4 -1
- package/lib/NavigatedViewer.js +4 -0
- package/lib/Viewer.d.ts +5 -2
- package/lib/Viewer.js +5 -1
- package/lib/features/context-pad/ContextPadProvider.js +4 -5
- package/lib/features/label-editing/LabelEditingProvider.js +21 -1
- package/lib/features/modeling/BpmnUpdater.d.ts +1 -3
- package/lib/features/modeling/BpmnUpdater.js +4 -17
- package/lib/features/modeling/ElementFactory.d.ts +1 -3
- package/lib/features/modeling/ElementFactory.js +5 -10
- package/lib/features/modeling/behavior/UpdateFlowNodeRefsBehavior.d.ts +1 -3
- package/lib/features/modeling/behavior/UpdateFlowNodeRefsBehavior.js +4 -7
- package/lib/features/modeling/cmd/SetColorHandler.js +1 -1
- package/lib/features/modeling/cmd/SplitLaneHandler.d.ts +1 -3
- package/lib/features/modeling/cmd/SplitLaneHandler.js +4 -9
- package/lib/features/modeling/cmd/UpdatePropertiesHandler.d.ts +1 -3
- package/lib/features/modeling/cmd/UpdatePropertiesHandler.js +3 -8
- package/lib/features/ordering/BpmnOrderingProvider.d.ts +1 -3
- package/lib/features/ordering/BpmnOrderingProvider.js +4 -6
- package/lib/features/ordering/index.d.ts +0 -1
- package/lib/features/ordering/index.js +0 -5
- package/lib/import/BpmnImporter.d.ts +1 -3
- package/lib/import/BpmnImporter.js +17 -29
- package/lib/import/BpmnTreeWalker.d.ts +1 -3
- package/lib/import/BpmnTreeWalker.js +32 -47
- package/lib/import/Importer.js +2 -4
- package/package.json +2 -2
|
@@ -10,13 +10,11 @@ export default class SplitLaneHandler implements CommandHandler {
|
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* @param modeling
|
|
13
|
-
* @param translate
|
|
14
13
|
*/
|
|
15
|
-
constructor(modeling: Modeling
|
|
14
|
+
constructor(modeling: Modeling);
|
|
16
15
|
|
|
17
16
|
preExecute(context: any): void;
|
|
18
17
|
}
|
|
19
18
|
|
|
20
19
|
type CommandHandler = import('diagram-js/lib/command/CommandHandler').default;
|
|
21
20
|
type Modeling = import('../Modeling').default;
|
|
22
|
-
export type Translate = typeof import("diagram-js/lib/i18n/translate/translate").default;
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
* @typedef {import('diagram-js/lib/command/CommandHandler').default} CommandHandler
|
|
12
12
|
*
|
|
13
13
|
* @typedef {import('../Modeling').default} Modeling
|
|
14
|
-
* @typedef {import('diagram-js/lib/i18n/translate/translate').default} Translate
|
|
15
14
|
*/
|
|
16
15
|
|
|
17
16
|
/**
|
|
@@ -21,23 +20,19 @@ import {
|
|
|
21
20
|
* @implements {CommandHandler}
|
|
22
21
|
*
|
|
23
22
|
* @param {Modeling} modeling
|
|
24
|
-
* @param {Translate} translate
|
|
25
23
|
*/
|
|
26
|
-
export default function SplitLaneHandler(modeling
|
|
24
|
+
export default function SplitLaneHandler(modeling) {
|
|
27
25
|
this._modeling = modeling;
|
|
28
|
-
this._translate = translate;
|
|
29
26
|
}
|
|
30
27
|
|
|
31
28
|
SplitLaneHandler.$inject = [
|
|
32
|
-
'modeling'
|
|
33
|
-
'translate'
|
|
29
|
+
'modeling'
|
|
34
30
|
];
|
|
35
31
|
|
|
36
32
|
|
|
37
33
|
SplitLaneHandler.prototype.preExecute = function(context) {
|
|
38
34
|
|
|
39
|
-
var modeling = this._modeling
|
|
40
|
-
translate = this._translate;
|
|
35
|
+
var modeling = this._modeling;
|
|
41
36
|
|
|
42
37
|
var shape = context.shape,
|
|
43
38
|
newLanesCount = context.count;
|
|
@@ -46,7 +41,7 @@ SplitLaneHandler.prototype.preExecute = function(context) {
|
|
|
46
41
|
existingLanesCount = childLanes.length;
|
|
47
42
|
|
|
48
43
|
if (existingLanesCount > newLanesCount) {
|
|
49
|
-
throw new Error(
|
|
44
|
+
throw new Error(`more than <${ newLanesCount }> child lanes`);
|
|
50
45
|
}
|
|
51
46
|
|
|
52
47
|
var isHorizontalLane = isHorizontal(shape);
|
|
@@ -16,11 +16,10 @@ export default class UpdatePropertiesHandler implements CommandHandler {
|
|
|
16
16
|
/**
|
|
17
17
|
* @param elementRegistry
|
|
18
18
|
* @param moddle
|
|
19
|
-
* @param translate
|
|
20
19
|
* @param modeling
|
|
21
20
|
* @param textRenderer
|
|
22
21
|
*/
|
|
23
|
-
constructor(elementRegistry: ElementRegistry, moddle: Moddle,
|
|
22
|
+
constructor(elementRegistry: ElementRegistry, moddle: Moddle, modeling: Modeling, textRenderer: TextRenderer);
|
|
24
23
|
|
|
25
24
|
/**
|
|
26
25
|
* Update a BPMN element's properties.
|
|
@@ -54,7 +53,6 @@ type CommandHandler = import('diagram-js/lib/command/CommandHandler').default;
|
|
|
54
53
|
type CommandContext = import('diagram-js/lib/command/CommandStack').CommandContext;
|
|
55
54
|
type ElementRegistry = import('diagram-js/lib/core/ElementRegistry').default;
|
|
56
55
|
type Moddle = import('../../../model/Types').Moddle;
|
|
57
|
-
export type Translate = typeof import("diagram-js/lib/i18n/translate/translate").default;
|
|
58
56
|
type Modeling = import('../Modeling').default;
|
|
59
57
|
type TextRenderer = import('../../../draw/TextRenderer').default;
|
|
60
58
|
type Element = import('../../../model/Types').Element;
|
|
@@ -16,7 +16,6 @@ import {
|
|
|
16
16
|
*
|
|
17
17
|
* @typedef {import('diagram-js/lib/core/ElementRegistry').default} ElementRegistry
|
|
18
18
|
* @typedef {import('../../../model/Types').Moddle} Moddle
|
|
19
|
-
* @typedef {import('diagram-js/lib/i18n/translate/translate').default} Translate
|
|
20
19
|
* @typedef {import('../Modeling').default} Modeling
|
|
21
20
|
* @typedef {import('../../../draw/TextRenderer').default} TextRenderer
|
|
22
21
|
*
|
|
@@ -45,17 +44,15 @@ var NULL_DIMENSIONS = {
|
|
|
45
44
|
*
|
|
46
45
|
* @param {ElementRegistry} elementRegistry
|
|
47
46
|
* @param {Moddle} moddle
|
|
48
|
-
* @param {Translate} translate
|
|
49
47
|
* @param {Modeling} modeling
|
|
50
48
|
* @param {TextRenderer} textRenderer
|
|
51
49
|
*/
|
|
52
50
|
export default function UpdatePropertiesHandler(
|
|
53
|
-
elementRegistry, moddle,
|
|
51
|
+
elementRegistry, moddle,
|
|
54
52
|
modeling, textRenderer) {
|
|
55
53
|
|
|
56
54
|
this._elementRegistry = elementRegistry;
|
|
57
55
|
this._moddle = moddle;
|
|
58
|
-
this._translate = translate;
|
|
59
56
|
this._modeling = modeling;
|
|
60
57
|
this._textRenderer = textRenderer;
|
|
61
58
|
}
|
|
@@ -63,7 +60,6 @@ export default function UpdatePropertiesHandler(
|
|
|
63
60
|
UpdatePropertiesHandler.$inject = [
|
|
64
61
|
'elementRegistry',
|
|
65
62
|
'moddle',
|
|
66
|
-
'translate',
|
|
67
63
|
'modeling',
|
|
68
64
|
'textRenderer'
|
|
69
65
|
];
|
|
@@ -84,11 +80,10 @@ UpdatePropertiesHandler.$inject = [
|
|
|
84
80
|
UpdatePropertiesHandler.prototype.execute = function(context) {
|
|
85
81
|
|
|
86
82
|
var element = context.element,
|
|
87
|
-
changed = [ element ]
|
|
88
|
-
translate = this._translate;
|
|
83
|
+
changed = [ element ];
|
|
89
84
|
|
|
90
85
|
if (!element) {
|
|
91
|
-
throw new Error(
|
|
86
|
+
throw new Error('element required');
|
|
92
87
|
}
|
|
93
88
|
|
|
94
89
|
var elementRegistry = this._elementRegistry,
|
|
@@ -6,9 +6,8 @@ export default class BpmnOrderingProvider extends OrderingProvider {
|
|
|
6
6
|
/**
|
|
7
7
|
* @param eventBus
|
|
8
8
|
* @param canvas
|
|
9
|
-
* @param translate
|
|
10
9
|
*/
|
|
11
|
-
constructor(eventBus: EventBus, canvas: Canvas
|
|
10
|
+
constructor(eventBus: EventBus, canvas: Canvas);
|
|
12
11
|
getOrdering: (element: any, newParent: any) => {
|
|
13
12
|
index: number;
|
|
14
13
|
parent: any;
|
|
@@ -17,5 +16,4 @@ export default class BpmnOrderingProvider extends OrderingProvider {
|
|
|
17
16
|
|
|
18
17
|
type Canvas = import('diagram-js/lib/core/Canvas').default;
|
|
19
18
|
type EventBus = import('diagram-js/lib/core/EventBus').default;
|
|
20
|
-
export type Translate = any;
|
|
21
19
|
import OrderingProvider from 'diagram-js/lib/features/ordering/OrderingProvider';
|
|
@@ -15,7 +15,6 @@ import {
|
|
|
15
15
|
/**
|
|
16
16
|
* @typedef {import('diagram-js/lib/core/Canvas').default} Canvas
|
|
17
17
|
* @typedef {import('diagram-js/lib/core/EventBus').default} EventBus
|
|
18
|
-
* @typedef {import('diagram-js/i18n/translate/translate').default} Translate
|
|
19
18
|
*/
|
|
20
19
|
|
|
21
20
|
/**
|
|
@@ -23,9 +22,8 @@ import {
|
|
|
23
22
|
*
|
|
24
23
|
* @param {EventBus} eventBus
|
|
25
24
|
* @param {Canvas} canvas
|
|
26
|
-
* @param {Translate} translate
|
|
27
25
|
*/
|
|
28
|
-
export default function BpmnOrderingProvider(eventBus, canvas
|
|
26
|
+
export default function BpmnOrderingProvider(eventBus, canvas) {
|
|
29
27
|
|
|
30
28
|
OrderingProvider.call(this, eventBus);
|
|
31
29
|
|
|
@@ -115,7 +113,7 @@ export default function BpmnOrderingProvider(eventBus, canvas, translate) {
|
|
|
115
113
|
}
|
|
116
114
|
|
|
117
115
|
if (!order) {
|
|
118
|
-
throw new Error(
|
|
116
|
+
throw new Error(`no order for <${ element.id }>`);
|
|
119
117
|
}
|
|
120
118
|
|
|
121
119
|
return order;
|
|
@@ -135,7 +133,7 @@ export default function BpmnOrderingProvider(eventBus, canvas, translate) {
|
|
|
135
133
|
}
|
|
136
134
|
|
|
137
135
|
if (!actualParent) {
|
|
138
|
-
throw new Error(
|
|
136
|
+
throw new Error(`no parent for <${ element.id }> in <${ newParent && newParent.id }>`);
|
|
139
137
|
}
|
|
140
138
|
|
|
141
139
|
return actualParent;
|
|
@@ -189,6 +187,6 @@ export default function BpmnOrderingProvider(eventBus, canvas, translate) {
|
|
|
189
187
|
};
|
|
190
188
|
}
|
|
191
189
|
|
|
192
|
-
BpmnOrderingProvider.$inject = [ 'eventBus', 'canvas'
|
|
190
|
+
BpmnOrderingProvider.$inject = [ 'eventBus', 'canvas' ];
|
|
193
191
|
|
|
194
192
|
inherits(BpmnOrderingProvider, OrderingProvider);
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import translate from 'diagram-js/lib/i18n/translate';
|
|
2
|
-
|
|
3
1
|
import BpmnOrderingProvider from './BpmnOrderingProvider';
|
|
4
2
|
|
|
5
3
|
export default {
|
|
6
|
-
__depends__: [
|
|
7
|
-
translate
|
|
8
|
-
],
|
|
9
4
|
__init__: [ 'bpmnOrderingProvider' ],
|
|
10
5
|
bpmnOrderingProvider: [ 'type', BpmnOrderingProvider ]
|
|
11
6
|
};
|
|
@@ -10,10 +10,9 @@ export default class BpmnImporter {
|
|
|
10
10
|
* @param canvas
|
|
11
11
|
* @param elementFactory
|
|
12
12
|
* @param elementRegistry
|
|
13
|
-
* @param translate
|
|
14
13
|
* @param textRenderer
|
|
15
14
|
*/
|
|
16
|
-
constructor(eventBus: EventBus, canvas: Canvas, elementFactory: ElementFactory, elementRegistry: ElementRegistry,
|
|
15
|
+
constructor(eventBus: EventBus, canvas: Canvas, elementFactory: ElementFactory, elementRegistry: ElementRegistry, textRenderer: TextRenderer);
|
|
17
16
|
|
|
18
17
|
/**
|
|
19
18
|
* Add a BPMN element (semantic) to the canvas making it a child of the
|
|
@@ -42,7 +41,6 @@ export default class BpmnImporter {
|
|
|
42
41
|
type Canvas = import('diagram-js/lib/core/Canvas').default;
|
|
43
42
|
type ElementRegistry = import('diagram-js/lib/core/ElementRegistry').default;
|
|
44
43
|
type EventBus = import('diagram-js/lib/core/EventBus').default;
|
|
45
|
-
export type Translate = typeof import("diagram-js/lib/i18n/translate/translate").default;
|
|
46
44
|
type ElementFactory = import('../features/modeling/ElementFactory').default;
|
|
47
45
|
type TextRenderer = import('../draw/TextRenderer').default;
|
|
48
46
|
type Element = import('../model/Types').Element;
|
|
@@ -26,7 +26,6 @@ import {
|
|
|
26
26
|
* @typedef {import('diagram-js/lib/core/Canvas').default} Canvas
|
|
27
27
|
* @typedef {import('diagram-js/lib/core/ElementRegistry').default} ElementRegistry
|
|
28
28
|
* @typedef {import('diagram-js/lib/core/EventBus').default} EventBus
|
|
29
|
-
* @typedef {import('diagram-js/lib/i18n/translate/translate').default} Translate
|
|
30
29
|
*
|
|
31
30
|
* @typedef {import('../features/modeling/ElementFactory').default} ElementFactory
|
|
32
31
|
* @typedef {import('../draw/TextRenderer').default} TextRenderer
|
|
@@ -68,12 +67,10 @@ function getWaypoints(di, source, target) {
|
|
|
68
67
|
});
|
|
69
68
|
}
|
|
70
69
|
|
|
71
|
-
function notYetDrawn(
|
|
72
|
-
return new Error(
|
|
73
|
-
element
|
|
74
|
-
|
|
75
|
-
property: property
|
|
76
|
-
}));
|
|
70
|
+
function notYetDrawn(semantic, refSemantic, property) {
|
|
71
|
+
return new Error(
|
|
72
|
+
`element ${ elementToString(refSemantic) } referenced by ${ elementToString(semantic) }#${ property } not yet drawn`
|
|
73
|
+
);
|
|
77
74
|
}
|
|
78
75
|
|
|
79
76
|
|
|
@@ -84,18 +81,16 @@ function notYetDrawn(translate, semantic, refSemantic, property) {
|
|
|
84
81
|
* @param {Canvas} canvas
|
|
85
82
|
* @param {ElementFactory} elementFactory
|
|
86
83
|
* @param {ElementRegistry} elementRegistry
|
|
87
|
-
* @param {Function} translate
|
|
88
84
|
* @param {TextRenderer} textRenderer
|
|
89
85
|
*/
|
|
90
86
|
export default function BpmnImporter(
|
|
91
87
|
eventBus, canvas, elementFactory,
|
|
92
|
-
elementRegistry,
|
|
88
|
+
elementRegistry, textRenderer) {
|
|
93
89
|
|
|
94
90
|
this._eventBus = eventBus;
|
|
95
91
|
this._canvas = canvas;
|
|
96
92
|
this._elementFactory = elementFactory;
|
|
97
93
|
this._elementRegistry = elementRegistry;
|
|
98
|
-
this._translate = translate;
|
|
99
94
|
this._textRenderer = textRenderer;
|
|
100
95
|
}
|
|
101
96
|
|
|
@@ -104,7 +99,6 @@ BpmnImporter.$inject = [
|
|
|
104
99
|
'canvas',
|
|
105
100
|
'elementFactory',
|
|
106
101
|
'elementRegistry',
|
|
107
|
-
'translate',
|
|
108
102
|
'textRenderer'
|
|
109
103
|
];
|
|
110
104
|
|
|
@@ -121,7 +115,6 @@ BpmnImporter.$inject = [
|
|
|
121
115
|
*/
|
|
122
116
|
BpmnImporter.prototype.add = function(semantic, di, parentElement) {
|
|
123
117
|
var element,
|
|
124
|
-
translate = this._translate,
|
|
125
118
|
hidden;
|
|
126
119
|
|
|
127
120
|
var parentIndex;
|
|
@@ -207,10 +200,9 @@ BpmnImporter.prototype.add = function(semantic, di, parentElement) {
|
|
|
207
200
|
|
|
208
201
|
this._canvas.addConnection(element, parentElement, parentIndex);
|
|
209
202
|
} else {
|
|
210
|
-
throw new Error(
|
|
211
|
-
di
|
|
212
|
-
|
|
213
|
-
}));
|
|
203
|
+
throw new Error(
|
|
204
|
+
`unknown di ${ elementToString(di) } for element ${ elementToString(semantic) }`
|
|
205
|
+
);
|
|
214
206
|
}
|
|
215
207
|
|
|
216
208
|
// (optional) LABEL
|
|
@@ -218,7 +210,6 @@ BpmnImporter.prototype.add = function(semantic, di, parentElement) {
|
|
|
218
210
|
this.addLabel(semantic, di, element);
|
|
219
211
|
}
|
|
220
212
|
|
|
221
|
-
|
|
222
213
|
this._eventBus.fire('bpmnElement.added', { element: element });
|
|
223
214
|
|
|
224
215
|
return element;
|
|
@@ -232,20 +223,19 @@ BpmnImporter.prototype.add = function(semantic, di, parentElement) {
|
|
|
232
223
|
* @param {Shape} boundaryElement
|
|
233
224
|
*/
|
|
234
225
|
BpmnImporter.prototype._attachBoundary = function(boundarySemantic, boundaryElement) {
|
|
235
|
-
var translate = this._translate;
|
|
236
226
|
var hostSemantic = boundarySemantic.attachedToRef;
|
|
237
227
|
|
|
238
228
|
if (!hostSemantic) {
|
|
239
|
-
throw new Error(
|
|
240
|
-
|
|
241
|
-
|
|
229
|
+
throw new Error(
|
|
230
|
+
`missing ${ elementToString(boundarySemantic) }#attachedToRef`
|
|
231
|
+
);
|
|
242
232
|
}
|
|
243
233
|
|
|
244
234
|
var host = this._elementRegistry.get(hostSemantic.id),
|
|
245
235
|
attachers = host && host.attachers;
|
|
246
236
|
|
|
247
237
|
if (!host) {
|
|
248
|
-
throw notYetDrawn(
|
|
238
|
+
throw notYetDrawn(boundarySemantic, hostSemantic, 'attachedToRef');
|
|
249
239
|
}
|
|
250
240
|
|
|
251
241
|
// wire element.host <> host.attachers
|
|
@@ -311,8 +301,7 @@ BpmnImporter.prototype._getConnectedElement = function(semantic, side) {
|
|
|
311
301
|
|
|
312
302
|
var element,
|
|
313
303
|
refSemantic,
|
|
314
|
-
type = semantic.$type
|
|
315
|
-
translate = this._translate;
|
|
304
|
+
type = semantic.$type;
|
|
316
305
|
|
|
317
306
|
refSemantic = semantic[side + 'Ref'];
|
|
318
307
|
|
|
@@ -335,12 +324,11 @@ BpmnImporter.prototype._getConnectedElement = function(semantic, side) {
|
|
|
335
324
|
}
|
|
336
325
|
|
|
337
326
|
if (refSemantic) {
|
|
338
|
-
throw notYetDrawn(
|
|
327
|
+
throw notYetDrawn(semantic, refSemantic, side + 'Ref');
|
|
339
328
|
} else {
|
|
340
|
-
throw new Error(
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
}));
|
|
329
|
+
throw new Error(
|
|
330
|
+
`${ elementToString(semantic) }#${ side } Ref not specified`
|
|
331
|
+
);
|
|
344
332
|
}
|
|
345
333
|
};
|
|
346
334
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
export default class BpmnTreeWalker {
|
|
2
2
|
/**
|
|
3
3
|
* @param handler
|
|
4
|
-
* @param translate
|
|
5
4
|
*/
|
|
6
|
-
constructor(handler: Record<'element' | 'root' | 'error', Function
|
|
5
|
+
constructor(handler: Record<'element' | 'root' | 'error', Function>);
|
|
7
6
|
registerDi: (di: any) => void;
|
|
8
7
|
/**
|
|
9
8
|
* Handle definitions and return the rendered diagram (if any).
|
|
@@ -18,5 +17,4 @@ export default class BpmnTreeWalker {
|
|
|
18
17
|
handleSubProcess: (subProcess: any, context: any) => void;
|
|
19
18
|
}
|
|
20
19
|
|
|
21
|
-
export type Translate = typeof import("diagram-js/lib/i18n/translate/translate").default;
|
|
22
20
|
type ModdleElement = import('../model/Types').ModdleElement;
|
|
@@ -13,8 +13,6 @@ import {
|
|
|
13
13
|
} from '../util/CompatibilityUtil';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* @typedef {import('diagram-js/lib/i18n/translate/translate').default} Translate
|
|
17
|
-
*
|
|
18
16
|
* @typedef {import('../model/Types').ModdleElement} ModdleElement
|
|
19
17
|
*/
|
|
20
18
|
|
|
@@ -47,9 +45,8 @@ function findDisplayCandidate(definitions) {
|
|
|
47
45
|
|
|
48
46
|
/**
|
|
49
47
|
* @param {Record<'element' | 'root' | 'error', Function>} handler
|
|
50
|
-
* @param {Translate} translate
|
|
51
48
|
*/
|
|
52
|
-
export default function BpmnTreeWalker(handler
|
|
49
|
+
export default function BpmnTreeWalker(handler) {
|
|
53
50
|
|
|
54
51
|
// list of containers already walked
|
|
55
52
|
var handledElements = {};
|
|
@@ -83,7 +80,7 @@ export default function BpmnTreeWalker(handler, translate) {
|
|
|
83
80
|
// avoid multiple rendering of elements
|
|
84
81
|
if (gfx) {
|
|
85
82
|
throw new Error(
|
|
86
|
-
|
|
83
|
+
`already rendered ${ elementToString(element) }`
|
|
87
84
|
);
|
|
88
85
|
}
|
|
89
86
|
|
|
@@ -103,11 +100,10 @@ export default function BpmnTreeWalker(handler, translate) {
|
|
|
103
100
|
handled(element);
|
|
104
101
|
|
|
105
102
|
return gfx;
|
|
106
|
-
} catch (
|
|
107
|
-
logError(
|
|
103
|
+
} catch (error) {
|
|
104
|
+
logError(error.message, { element, error });
|
|
108
105
|
|
|
109
|
-
console.error(
|
|
110
|
-
console.error(e);
|
|
106
|
+
console.error(`failed to import ${ elementToString(element) }`, error);
|
|
111
107
|
}
|
|
112
108
|
}
|
|
113
109
|
|
|
@@ -123,9 +119,7 @@ export default function BpmnTreeWalker(handler, translate) {
|
|
|
123
119
|
if (bpmnElement) {
|
|
124
120
|
if (diMap[bpmnElement.id]) {
|
|
125
121
|
logError(
|
|
126
|
-
|
|
127
|
-
element: elementToString(bpmnElement)
|
|
128
|
-
}),
|
|
122
|
+
`multiple DI elements defined for ${ elementToString(bpmnElement) }`,
|
|
129
123
|
{ element: bpmnElement }
|
|
130
124
|
);
|
|
131
125
|
} else {
|
|
@@ -135,9 +129,7 @@ export default function BpmnTreeWalker(handler, translate) {
|
|
|
135
129
|
}
|
|
136
130
|
} else {
|
|
137
131
|
logError(
|
|
138
|
-
|
|
139
|
-
element: elementToString(di)
|
|
140
|
-
}),
|
|
132
|
+
`no bpmnElement referenced in ${ elementToString(di) }`,
|
|
141
133
|
{ element: di }
|
|
142
134
|
);
|
|
143
135
|
}
|
|
@@ -175,7 +167,7 @@ export default function BpmnTreeWalker(handler, translate) {
|
|
|
175
167
|
var diagrams = definitions.diagrams;
|
|
176
168
|
|
|
177
169
|
if (diagram && diagrams.indexOf(diagram) === -1) {
|
|
178
|
-
throw new Error(
|
|
170
|
+
throw new Error('diagram not part of <bpmn:Definitions />');
|
|
179
171
|
}
|
|
180
172
|
|
|
181
173
|
if (!diagram && diagrams && diagrams.length) {
|
|
@@ -184,7 +176,7 @@ export default function BpmnTreeWalker(handler, translate) {
|
|
|
184
176
|
|
|
185
177
|
// no diagram -> nothing to import
|
|
186
178
|
if (!diagram) {
|
|
187
|
-
throw new Error(
|
|
179
|
+
throw new Error('no diagram to display');
|
|
188
180
|
}
|
|
189
181
|
|
|
190
182
|
// load DI from selected diagram only
|
|
@@ -195,10 +187,9 @@ export default function BpmnTreeWalker(handler, translate) {
|
|
|
195
187
|
var plane = diagram.plane;
|
|
196
188
|
|
|
197
189
|
if (!plane) {
|
|
198
|
-
throw new Error(
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
));
|
|
190
|
+
throw new Error(
|
|
191
|
+
`no plane for ${ elementToString(diagram) }`
|
|
192
|
+
);
|
|
202
193
|
}
|
|
203
194
|
|
|
204
195
|
var rootElement = plane.bpmnElement;
|
|
@@ -209,14 +200,11 @@ export default function BpmnTreeWalker(handler, translate) {
|
|
|
209
200
|
rootElement = findDisplayCandidate(definitions);
|
|
210
201
|
|
|
211
202
|
if (!rootElement) {
|
|
212
|
-
throw new Error(
|
|
203
|
+
throw new Error('no process or collaboration to display');
|
|
213
204
|
} else {
|
|
214
205
|
|
|
215
206
|
logError(
|
|
216
|
-
|
|
217
|
-
plane: elementToString(plane),
|
|
218
|
-
rootElement: elementToString(rootElement)
|
|
219
|
-
})
|
|
207
|
+
`correcting missing bpmnElement on ${ elementToString(plane) } to ${ elementToString(rootElement) }`
|
|
220
208
|
);
|
|
221
209
|
|
|
222
210
|
// correct DI on the fly
|
|
@@ -237,10 +225,7 @@ export default function BpmnTreeWalker(handler, translate) {
|
|
|
237
225
|
handleUnhandledProcesses(definitions.rootElements, ctx);
|
|
238
226
|
} else {
|
|
239
227
|
throw new Error(
|
|
240
|
-
|
|
241
|
-
plane: elementToString(plane),
|
|
242
|
-
rootElement: elementToString(rootElement)
|
|
243
|
-
})
|
|
228
|
+
`unsupported bpmnElement for ${ elementToString(plane) }: ${ elementToString(rootElement) }`
|
|
244
229
|
);
|
|
245
230
|
}
|
|
246
231
|
|
|
@@ -402,31 +387,31 @@ export default function BpmnTreeWalker(handler, translate) {
|
|
|
402
387
|
}
|
|
403
388
|
|
|
404
389
|
function handleFlowElements(flowElements, context) {
|
|
405
|
-
forEach(flowElements, function(
|
|
406
|
-
if (is(
|
|
390
|
+
forEach(flowElements, function(flowElement) {
|
|
391
|
+
if (is(flowElement, 'bpmn:SequenceFlow')) {
|
|
407
392
|
deferred.push(function() {
|
|
408
|
-
handleSequenceFlow(
|
|
393
|
+
handleSequenceFlow(flowElement, context);
|
|
409
394
|
});
|
|
410
|
-
} else if (is(
|
|
395
|
+
} else if (is(flowElement, 'bpmn:BoundaryEvent')) {
|
|
411
396
|
deferred.unshift(function() {
|
|
412
|
-
handleFlowNode(
|
|
397
|
+
handleFlowNode(flowElement, context);
|
|
413
398
|
});
|
|
414
|
-
} else if (is(
|
|
415
|
-
handleFlowNode(
|
|
416
|
-
} else if (is(
|
|
399
|
+
} else if (is(flowElement, 'bpmn:FlowNode')) {
|
|
400
|
+
handleFlowNode(flowElement, context);
|
|
401
|
+
} else if (is(flowElement, 'bpmn:DataObject')) {
|
|
417
402
|
|
|
418
403
|
// SKIP (assume correct referencing via DataObjectReference)
|
|
419
|
-
} else if (is(
|
|
420
|
-
handleDataElement(
|
|
421
|
-
} else if (is(
|
|
422
|
-
handleDataElement(
|
|
404
|
+
} else if (is(flowElement, 'bpmn:DataStoreReference')) {
|
|
405
|
+
handleDataElement(flowElement, context);
|
|
406
|
+
} else if (is(flowElement, 'bpmn:DataObjectReference')) {
|
|
407
|
+
handleDataElement(flowElement, context);
|
|
423
408
|
} else {
|
|
424
409
|
logError(
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
410
|
+
`unrecognized flowElement ${ elementToString(flowElement) } in context ${ elementToString(context && context.businessObject) }`,
|
|
411
|
+
{
|
|
412
|
+
element: flowElement,
|
|
413
|
+
context
|
|
414
|
+
}
|
|
430
415
|
);
|
|
431
416
|
}
|
|
432
417
|
});
|
package/lib/import/Importer.js
CHANGED
|
@@ -35,7 +35,6 @@ export function importBpmnDiagram(diagram, definitions, bpmnDiagram) {
|
|
|
35
35
|
|
|
36
36
|
var importer,
|
|
37
37
|
eventBus,
|
|
38
|
-
translate,
|
|
39
38
|
canvas;
|
|
40
39
|
|
|
41
40
|
var error,
|
|
@@ -65,7 +64,7 @@ export function importBpmnDiagram(diagram, definitions, bpmnDiagram) {
|
|
|
65
64
|
}
|
|
66
65
|
};
|
|
67
66
|
|
|
68
|
-
var walker = new BpmnTreeWalker(visitor
|
|
67
|
+
var walker = new BpmnTreeWalker(visitor);
|
|
69
68
|
|
|
70
69
|
|
|
71
70
|
bpmnDiagram = bpmnDiagram || (definitions.diagrams && definitions.diagrams[0]);
|
|
@@ -73,7 +72,7 @@ export function importBpmnDiagram(diagram, definitions, bpmnDiagram) {
|
|
|
73
72
|
var diagramsToImport = getDiagramsToImport(definitions, bpmnDiagram);
|
|
74
73
|
|
|
75
74
|
if (!diagramsToImport) {
|
|
76
|
-
throw new Error(
|
|
75
|
+
throw new Error('no diagram to display');
|
|
77
76
|
}
|
|
78
77
|
|
|
79
78
|
// traverse BPMN 2.0 document model,
|
|
@@ -96,7 +95,6 @@ export function importBpmnDiagram(diagram, definitions, bpmnDiagram) {
|
|
|
96
95
|
try {
|
|
97
96
|
importer = diagram.get('bpmnImporter');
|
|
98
97
|
eventBus = diagram.get('eventBus');
|
|
99
|
-
translate = diagram.get('translate');
|
|
100
98
|
canvas = diagram.get('canvas');
|
|
101
99
|
|
|
102
100
|
eventBus.fire('import.render.start', { definitions: definitions });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bpmn-js",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.6.0",
|
|
4
4
|
"description": "A bpmn 2.0 toolkit and web modeler",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"dependencies": {
|
|
114
114
|
"bpmn-moddle": "^8.1.0",
|
|
115
115
|
"diagram-js": "^14.4.1",
|
|
116
|
-
"diagram-js-direct-editing": "^
|
|
116
|
+
"diagram-js-direct-editing": "^3.0.1",
|
|
117
117
|
"ids": "^1.0.5",
|
|
118
118
|
"inherits-browser": "^0.1.0",
|
|
119
119
|
"min-dash": "^4.1.1",
|