bpmn-moddle 7.0.4 → 7.1.2
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/CHANGELOG.md +17 -0
- package/README.md +1 -1
- package/dist/bpmn-moddle.umd.js +78 -27
- package/dist/bpmn-moddle.umd.prod.js +1 -1
- package/dist/index.esm.js +66 -2
- package/dist/index.js +66 -2
- package/package.json +19 -13
- package/resources/bpmn/json/bpmn.json +2 -1
- package/tasks/generate-schema.js +0 -86
- package/tasks/transforms/helper.js +0 -513
- package/tasks/transforms/index.js +0 -11
- package/tasks/transforms/transformBPMN.js +0 -371
- package/tasks/transforms/transformBPMNDI.js +0 -16
- package/tasks/transforms/transformDC.js +0 -10
- package/tasks/transforms/transformDI.js +0 -63
|
@@ -1,371 +0,0 @@
|
|
|
1
|
-
const {
|
|
2
|
-
findProperty,
|
|
3
|
-
findType,
|
|
4
|
-
orderProperties,
|
|
5
|
-
replaceKey,
|
|
6
|
-
replaceValue,
|
|
7
|
-
swapProperties
|
|
8
|
-
} = require('./helper');
|
|
9
|
-
|
|
10
|
-
module.exports = async function(results) {
|
|
11
|
-
const { elementsByType } = results;
|
|
12
|
-
|
|
13
|
-
let model = elementsByType[ 'cmof:Package' ][ 0 ];
|
|
14
|
-
|
|
15
|
-
model.xml = {
|
|
16
|
-
tagAlias: 'lowerCase',
|
|
17
|
-
typePrefix: 't'
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
// remove associations
|
|
21
|
-
model.associations = [];
|
|
22
|
-
|
|
23
|
-
findProperty('BaseElement#id', model).isId = true;
|
|
24
|
-
|
|
25
|
-
// fix extension elements
|
|
26
|
-
Object.assign(findProperty('ExtensionAttributeValue#value', model), {
|
|
27
|
-
name: 'values',
|
|
28
|
-
isMany: true
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
const extensionValues = findProperty('BaseElement#extensionValues', model);
|
|
32
|
-
|
|
33
|
-
extensionValues.name = 'extensionElements';
|
|
34
|
-
|
|
35
|
-
delete extensionValues.isMany;
|
|
36
|
-
|
|
37
|
-
// replace all occurrences of `extensionAttributeValue` with `extensionElements`
|
|
38
|
-
replaceKey('extensionAttributeValue', 'extensionElements', model);
|
|
39
|
-
|
|
40
|
-
// replace all occurrences of `extensionValues` with `extensionElements`
|
|
41
|
-
replaceKey('extensionValues', 'extensionElements', model);
|
|
42
|
-
|
|
43
|
-
// replace all occurrences of `ExtensionAttributeValue` with `ExtensionElements`
|
|
44
|
-
replaceValue('ExtensionAttributeValue', 'ExtensionElements', model);
|
|
45
|
-
|
|
46
|
-
// fix bpmn:Extension definition
|
|
47
|
-
Object.assign(findProperty('Extension#definition', model), {
|
|
48
|
-
isAttr: true,
|
|
49
|
-
isReference: true
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
model = orderProperties('BaseElement', [ 'id', 'documentation' ], model);
|
|
53
|
-
|
|
54
|
-
model = orderProperties('Definitions', [
|
|
55
|
-
'name',
|
|
56
|
-
'targetNamespace',
|
|
57
|
-
'expressionLanguage',
|
|
58
|
-
'typeLanguage',
|
|
59
|
-
'imports',
|
|
60
|
-
'extensions',
|
|
61
|
-
'rootElements',
|
|
62
|
-
'diagrams',
|
|
63
|
-
'exporter',
|
|
64
|
-
'relationships',
|
|
65
|
-
'exporterVersion'
|
|
66
|
-
], model);
|
|
67
|
-
|
|
68
|
-
model = orderProperties('InputOutputSpecification', [
|
|
69
|
-
'dataInputs',
|
|
70
|
-
'dataOutputs',
|
|
71
|
-
'inputSets',
|
|
72
|
-
'outputSets'
|
|
73
|
-
], model);
|
|
74
|
-
|
|
75
|
-
findProperty('Relationship#sources', model).name = 'source';
|
|
76
|
-
|
|
77
|
-
findProperty('Relationship#targets', model).name = 'target';
|
|
78
|
-
|
|
79
|
-
findProperty('CatchEvent#dataOutputAssociation', model).name = 'dataOutputAssociations';
|
|
80
|
-
|
|
81
|
-
findProperty('ThrowEvent#dataInputAssociation', model).name = 'dataInputAssociations';
|
|
82
|
-
|
|
83
|
-
model = orderProperties('CatchEvent', [
|
|
84
|
-
'parallelMultiple',
|
|
85
|
-
'dataOutputs',
|
|
86
|
-
'dataOutputAssociations',
|
|
87
|
-
'outputSet',
|
|
88
|
-
'eventDefinitions',
|
|
89
|
-
'eventDefinitionRefs'
|
|
90
|
-
], model);
|
|
91
|
-
|
|
92
|
-
model = orderProperties('ThrowEvent', [
|
|
93
|
-
'dataInputs',
|
|
94
|
-
'dataInputAssociations',
|
|
95
|
-
'inputSet',
|
|
96
|
-
'eventDefinitions',
|
|
97
|
-
'eventDefinitionRefs'
|
|
98
|
-
], model);
|
|
99
|
-
|
|
100
|
-
model = orderProperties('Collaboration', [
|
|
101
|
-
'name',
|
|
102
|
-
'isClosed',
|
|
103
|
-
'participants',
|
|
104
|
-
'messageFlows',
|
|
105
|
-
'artifacts',
|
|
106
|
-
'conversations',
|
|
107
|
-
'conversationAssociations',
|
|
108
|
-
'participantAssociations',
|
|
109
|
-
'messageFlowAssociations',
|
|
110
|
-
'correlationKeys',
|
|
111
|
-
'choreographyRef',
|
|
112
|
-
'conversationLinks'
|
|
113
|
-
], model);
|
|
114
|
-
|
|
115
|
-
delete findProperty('ResourceRole#resourceRef', model).isAttr;
|
|
116
|
-
|
|
117
|
-
[
|
|
118
|
-
'ResourceParameterBinding',
|
|
119
|
-
'ResourceAssignmentExpression',
|
|
120
|
-
'ParticipantMultiplicity'
|
|
121
|
-
].forEach(name => {
|
|
122
|
-
findType(name, model).superClass = [ 'BaseElement' ];
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
model = swapProperties(
|
|
126
|
-
'FlowElementsContainer#laneSets',
|
|
127
|
-
'FlowElementsContainer#flowElements',
|
|
128
|
-
model
|
|
129
|
-
);
|
|
130
|
-
|
|
131
|
-
model = swapProperties(
|
|
132
|
-
'FlowNode#sourceRef',
|
|
133
|
-
'FlowNode#targetRef',
|
|
134
|
-
model
|
|
135
|
-
);
|
|
136
|
-
|
|
137
|
-
model = swapProperties(
|
|
138
|
-
'FlowNode#incoming',
|
|
139
|
-
'FlowNode#outgoing',
|
|
140
|
-
model
|
|
141
|
-
);
|
|
142
|
-
|
|
143
|
-
model = orderProperties('DataAssociation', [
|
|
144
|
-
'sourceRef',
|
|
145
|
-
'targetRef',
|
|
146
|
-
'transformation'
|
|
147
|
-
], model);
|
|
148
|
-
|
|
149
|
-
findProperty('DataAssociation#transformation', model).xml = {
|
|
150
|
-
serialize: 'property'
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
findType('Choreography', model).superClass = [ 'Collaboration', 'FlowElementsContainer' ];
|
|
154
|
-
|
|
155
|
-
model = orderProperties('Activity', [
|
|
156
|
-
'isForCompensation',
|
|
157
|
-
'default',
|
|
158
|
-
'ioSpecification',
|
|
159
|
-
'boundaryEventRefs',
|
|
160
|
-
'properties',
|
|
161
|
-
'dataInputAssociations',
|
|
162
|
-
'dataOutputAssociations',
|
|
163
|
-
'startQuantity',
|
|
164
|
-
'resources',
|
|
165
|
-
'completionQuantity',
|
|
166
|
-
'loopCharacteristics'
|
|
167
|
-
], model);
|
|
168
|
-
|
|
169
|
-
model = orderProperties('DataAssociation', [
|
|
170
|
-
'sourceRef',
|
|
171
|
-
'targetRef',
|
|
172
|
-
'transformation',
|
|
173
|
-
'assignment'
|
|
174
|
-
], model);
|
|
175
|
-
|
|
176
|
-
findProperty('CallableElement#supportedInterfaceRefs', model).name = 'supportedInterfaceRef';
|
|
177
|
-
|
|
178
|
-
findProperty('Participant#interfaceRefs', model).name = 'interfaceRef';
|
|
179
|
-
|
|
180
|
-
findProperty('Operation#errorRefs', model).name = 'errorRef';
|
|
181
|
-
|
|
182
|
-
findProperty('ThrowEvent#eventDefinitionRefs', model).name = 'eventDefinitionRef';
|
|
183
|
-
|
|
184
|
-
findProperty('CatchEvent#eventDefinitionRefs', model).name = 'eventDefinitionRef';
|
|
185
|
-
|
|
186
|
-
findProperty('DataInput#inputSetRefs', model).name = 'inputSetRef';
|
|
187
|
-
|
|
188
|
-
findProperty('DataOutput#outputSetRefs', model).name = 'outputSetRef';
|
|
189
|
-
|
|
190
|
-
findProperty('ChoreographyActivity#participantRefs', model).name = 'participantRef';
|
|
191
|
-
|
|
192
|
-
findProperty('ConversationNode#participantRefs', model).name = 'participantRef';
|
|
193
|
-
|
|
194
|
-
const process = findType('Process', model);
|
|
195
|
-
|
|
196
|
-
process.properties.push({
|
|
197
|
-
name: 'laneSets',
|
|
198
|
-
isMany: true,
|
|
199
|
-
replaces: 'FlowElementsContainer#laneSets',
|
|
200
|
-
type: 'LaneSet'
|
|
201
|
-
}, {
|
|
202
|
-
name: 'flowElements',
|
|
203
|
-
isMany: true,
|
|
204
|
-
replaces: 'FlowElementsContainer#flowElements',
|
|
205
|
-
type: 'FlowElement'
|
|
206
|
-
});
|
|
207
|
-
|
|
208
|
-
model = orderProperties('Process', [
|
|
209
|
-
'processType',
|
|
210
|
-
'isClosed',
|
|
211
|
-
'auditing',
|
|
212
|
-
'monitoring',
|
|
213
|
-
'properties',
|
|
214
|
-
'laneSets',
|
|
215
|
-
'flowElements',
|
|
216
|
-
'artifacts',
|
|
217
|
-
'resources',
|
|
218
|
-
'correlationSubscriptions',
|
|
219
|
-
'supports'
|
|
220
|
-
], model);
|
|
221
|
-
|
|
222
|
-
findType('SubProcess', model).superClass.push('InteractionNode');
|
|
223
|
-
|
|
224
|
-
const text = findProperty('Documentation#text', model);
|
|
225
|
-
|
|
226
|
-
text.isBody = true;
|
|
227
|
-
|
|
228
|
-
delete text.isAttr;
|
|
229
|
-
|
|
230
|
-
delete findProperty('ScriptTask#script', model).isAttr;
|
|
231
|
-
|
|
232
|
-
delete findProperty('TextAnnotation#text', model).isAttr;
|
|
233
|
-
|
|
234
|
-
findType('Expression', model).isAbstract = true;
|
|
235
|
-
|
|
236
|
-
// serialize `Expression` as `xsi:type`
|
|
237
|
-
model.types.forEach(type => {
|
|
238
|
-
if (type.properties) {
|
|
239
|
-
type.properties.forEach(property => {
|
|
240
|
-
if (property.type === 'Expression') {
|
|
241
|
-
property.xml = {
|
|
242
|
-
serialize: 'xsi:type'
|
|
243
|
-
};
|
|
244
|
-
}
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
});
|
|
248
|
-
|
|
249
|
-
const loopMaximum = findProperty('StandardLoopCharacteristics#loopMaximum', model);
|
|
250
|
-
|
|
251
|
-
loopMaximum.isAttr = true;
|
|
252
|
-
|
|
253
|
-
loopMaximum.type = 'Integer';
|
|
254
|
-
|
|
255
|
-
delete loopMaximum.xml;
|
|
256
|
-
|
|
257
|
-
delete findProperty('MultiInstanceLoopCharacteristics#loopDataInputRef', model).isAttr;
|
|
258
|
-
|
|
259
|
-
delete findProperty('MultiInstanceLoopCharacteristics#loopDataOutputRef', model).isAttr;
|
|
260
|
-
|
|
261
|
-
[
|
|
262
|
-
'MultiInstanceLoopCharacteristics#inputDataItem',
|
|
263
|
-
'MultiInstanceLoopCharacteristics#outputDataItem'
|
|
264
|
-
].forEach(name => {
|
|
265
|
-
findProperty(name, model).xml = {
|
|
266
|
-
serialize: 'property'
|
|
267
|
-
};
|
|
268
|
-
});
|
|
269
|
-
|
|
270
|
-
model = orderProperties('MultiInstanceLoopCharacteristics', [
|
|
271
|
-
'isSequential',
|
|
272
|
-
'behavior',
|
|
273
|
-
'loopCardinality',
|
|
274
|
-
'loopDataInputRef',
|
|
275
|
-
'loopDataOutputRef',
|
|
276
|
-
'inputDataItem',
|
|
277
|
-
'outputDataItem',
|
|
278
|
-
'complexBehaviorDefinition',
|
|
279
|
-
'completionCondition'
|
|
280
|
-
], model);
|
|
281
|
-
|
|
282
|
-
[
|
|
283
|
-
'Operation#implementationRef',
|
|
284
|
-
'Interface#implementationRef',
|
|
285
|
-
'ItemDefinition#structureRef'
|
|
286
|
-
].forEach(name => {
|
|
287
|
-
const property = findProperty(name, model);
|
|
288
|
-
|
|
289
|
-
property.type = 'String';
|
|
290
|
-
|
|
291
|
-
property.isAttr = true;
|
|
292
|
-
|
|
293
|
-
delete property.isReference;
|
|
294
|
-
});
|
|
295
|
-
|
|
296
|
-
const calledElementRef = findProperty('CallActivity#calledElementRef', model);
|
|
297
|
-
|
|
298
|
-
calledElementRef.name = 'calledElement';
|
|
299
|
-
|
|
300
|
-
calledElementRef.type = 'String';
|
|
301
|
-
|
|
302
|
-
delete calledElementRef.isReference;
|
|
303
|
-
|
|
304
|
-
findProperty('Gateway#gatewayDirection', model).default = 'Unspecified';
|
|
305
|
-
|
|
306
|
-
findProperty('CompensateEventDefinition#waitForCompletion', model).default = true;
|
|
307
|
-
|
|
308
|
-
findProperty('EventBasedGateway#eventGatewayType', model).default = 'Exclusive';
|
|
309
|
-
|
|
310
|
-
findProperty('CatchEvent#parallelMultiple', model).default = false;
|
|
311
|
-
|
|
312
|
-
findProperty('ParticipantMultiplicity#minimum', model).default = 0;
|
|
313
|
-
|
|
314
|
-
[
|
|
315
|
-
'ParticipantMultiplicity#maximum',
|
|
316
|
-
'Activity#startQuantity',
|
|
317
|
-
'Activity#completionQuantity'
|
|
318
|
-
].forEach(name => {
|
|
319
|
-
findProperty(name, model).default = 1;
|
|
320
|
-
});
|
|
321
|
-
|
|
322
|
-
delete findProperty('DataAssociation#targetRef', model).isAttr;
|
|
323
|
-
|
|
324
|
-
findProperty('Lane#flowNodeRefs', model).name = 'flowNodeRef';
|
|
325
|
-
|
|
326
|
-
findProperty('Lane#childLaneSet', model).xml = {
|
|
327
|
-
serialize: 'xsi:type'
|
|
328
|
-
};
|
|
329
|
-
|
|
330
|
-
model = orderProperties('Lane', [
|
|
331
|
-
'name',
|
|
332
|
-
'partitionElementRef',
|
|
333
|
-
'partitionElement',
|
|
334
|
-
'flowNodeRef',
|
|
335
|
-
'childLaneSet'
|
|
336
|
-
], model);
|
|
337
|
-
|
|
338
|
-
findType('Escalation', model).superClass = [ 'RootElement' ];
|
|
339
|
-
|
|
340
|
-
const expression = findType('Expression', model);
|
|
341
|
-
|
|
342
|
-
expression.isAbstract = false;
|
|
343
|
-
|
|
344
|
-
expression.properties = [{
|
|
345
|
-
name: 'body',
|
|
346
|
-
isBody: true,
|
|
347
|
-
type: 'String'
|
|
348
|
-
}];
|
|
349
|
-
|
|
350
|
-
const formalExpression = findType('FormalExpression', model);
|
|
351
|
-
|
|
352
|
-
formalExpression.properties = formalExpression.properties.filter(({ name }) => {
|
|
353
|
-
return name !== 'body';
|
|
354
|
-
});
|
|
355
|
-
|
|
356
|
-
[
|
|
357
|
-
'CallableElement#ioSpecification',
|
|
358
|
-
'CallableElement#ioBinding',
|
|
359
|
-
'Activity#ioSpecification'
|
|
360
|
-
].forEach(name => {
|
|
361
|
-
findProperty(name, model).xml = {
|
|
362
|
-
serialize: 'property'
|
|
363
|
-
};
|
|
364
|
-
});
|
|
365
|
-
|
|
366
|
-
delete findProperty('Operation#inMessageRef', model).isAttr;
|
|
367
|
-
|
|
368
|
-
delete findProperty('Operation#outMessageRef', model).isAttr;
|
|
369
|
-
|
|
370
|
-
return model;
|
|
371
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
const {
|
|
2
|
-
findProperty
|
|
3
|
-
} = require('./helper');
|
|
4
|
-
|
|
5
|
-
module.exports = async function(results) {
|
|
6
|
-
const { elementsByType } = results;
|
|
7
|
-
|
|
8
|
-
let model = elementsByType[ 'cmof:Package' ][ 0 ];
|
|
9
|
-
|
|
10
|
-
// remove associations
|
|
11
|
-
model.associations = [];
|
|
12
|
-
|
|
13
|
-
findProperty('BPMNEdge#messageVisibleKind', model).default = 'initiating';
|
|
14
|
-
|
|
15
|
-
return model;
|
|
16
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
const {
|
|
2
|
-
findProperty,
|
|
3
|
-
findType
|
|
4
|
-
} = require('./helper');
|
|
5
|
-
|
|
6
|
-
module.exports = async function(results) {
|
|
7
|
-
const { elementsByType } = results;
|
|
8
|
-
|
|
9
|
-
let model = elementsByType[ 'cmof:Package' ][ 0 ];
|
|
10
|
-
|
|
11
|
-
model.xml = {
|
|
12
|
-
tagAlias: 'lowerCase'
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
// remove associations
|
|
16
|
-
model.associations = [];
|
|
17
|
-
|
|
18
|
-
model.types.push({
|
|
19
|
-
name: 'Extension',
|
|
20
|
-
properties: [
|
|
21
|
-
{
|
|
22
|
-
name: 'values',
|
|
23
|
-
isMany: true,
|
|
24
|
-
type: 'Element'
|
|
25
|
-
}
|
|
26
|
-
]
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
const diagramElement = findType('DiagramElement', model);
|
|
30
|
-
|
|
31
|
-
diagramElement.properties.unshift({
|
|
32
|
-
name: 'extension',
|
|
33
|
-
type: 'Extension'
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
diagramElement.properties.unshift({
|
|
37
|
-
name: 'id',
|
|
38
|
-
isAttr: true,
|
|
39
|
-
isId: true,
|
|
40
|
-
type: 'String'
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
findType('Diagram', model).properties.unshift({
|
|
44
|
-
name: 'id',
|
|
45
|
-
isAttr: true,
|
|
46
|
-
isId: true,
|
|
47
|
-
type: 'String'
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
findType('Style', model).properties = [{
|
|
52
|
-
name: 'id',
|
|
53
|
-
isAttr: true,
|
|
54
|
-
isId: true,
|
|
55
|
-
type: 'String'
|
|
56
|
-
}];
|
|
57
|
-
|
|
58
|
-
findProperty('Edge#waypoint', model).xml = {
|
|
59
|
-
serialize: 'xsi:type'
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
return model;
|
|
63
|
-
};
|