bpmn-js 17.4.0 → 17.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.
- package/dist/bpmn-modeler.development.js +94 -139
- package/dist/bpmn-modeler.production.min.js +5 -5
- package/dist/bpmn-navigated-viewer.development.js +51 -80
- package/dist/bpmn-navigated-viewer.production.min.js +4 -4
- package/dist/bpmn-viewer.development.js +51 -80
- package/dist/bpmn-viewer.production.min.js +4 -4
- 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/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 +2 -4
- 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
|
@@ -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.5.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",
|