bpmn-moddle 0.14.0 → 0.14.1

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 (89) hide show
  1. package/.travis.yml +2 -5
  2. package/package.json +4 -4
  3. package/resources/bpmn/json/bpmn.json +1 -1
  4. package/resources/bpmn/json/bpmndi.json +1 -1
  5. package/resources/bpmn-io/json/bioc.json +1 -1
  6. package/.npmignore +0 -6
  7. package/test/expect.js +0 -7
  8. package/test/fixtures/bpmn/activity-children.bpmn +0 -23
  9. package/test/fixtures/bpmn/callActivity-calledElement.part.bpmn +0 -7
  10. package/test/fixtures/bpmn/catch-event-dataOutputAssociations.part.bpmn +0 -5
  11. package/test/fixtures/bpmn/category.bpmn +0 -28
  12. package/test/fixtures/bpmn/complex.bpmn +0 -3680
  13. package/test/fixtures/bpmn/conversation-children.bpmn +0 -23
  14. package/test/fixtures/bpmn/data-object-reference.bpmn +0 -17
  15. package/test/fixtures/bpmn/definitions-children.bpmn +0 -13
  16. package/test/fixtures/bpmn/di/bpmnDiagram-extension.part.bpmn +0 -17
  17. package/test/fixtures/bpmn/di/bpmnDiagram.part.bpmn +0 -12
  18. package/test/fixtures/bpmn/di/bpmnEdge-waypoint.part.bpmn +0 -4
  19. package/test/fixtures/bpmn/di/bpmnEdge.part.bpmn +0 -5
  20. package/test/fixtures/bpmn/di/bpmnShape.part.bpmn +0 -4
  21. package/test/fixtures/bpmn/di-extension.bpmn +0 -26
  22. package/test/fixtures/bpmn/documentation-extension-elements.bpmn +0 -15
  23. package/test/fixtures/bpmn/documentation.bpmn +0 -11
  24. package/test/fixtures/bpmn/empty-definitions-default-ns.bpmn +0 -4
  25. package/test/fixtures/bpmn/empty-definitions.bpmn +0 -5
  26. package/test/fixtures/bpmn/error/binary.png +0 -0
  27. package/test/fixtures/bpmn/error/categoryValue.bpmn +0 -27
  28. package/test/fixtures/bpmn/error/di-no-bpmn-element.bpmn +0 -13
  29. package/test/fixtures/bpmn/error/duplicate-ids.bpmn +0 -8
  30. package/test/fixtures/bpmn/error/extension-definition-missing.bpmn +0 -6
  31. package/test/fixtures/bpmn/error/no-xml.txt +0 -1
  32. package/test/fixtures/bpmn/error/undeclared-ns-child.bpmn +0 -6
  33. package/test/fixtures/bpmn/error/unrecognized-child.bpmn +0 -6
  34. package/test/fixtures/bpmn/escalation-error.bpmn +0 -6
  35. package/test/fixtures/bpmn/event-references.part.bpmn +0 -6
  36. package/test/fixtures/bpmn/example-colors.bpmn +0 -40
  37. package/test/fixtures/bpmn/expression-plain.bpmn +0 -40
  38. package/test/fixtures/bpmn/extension/camunda/inputOutput-list.part.bpmn +0 -9
  39. package/test/fixtures/bpmn/extension/camunda/inputOutput-map.part.bpmn +0 -12
  40. package/test/fixtures/bpmn/extension/camunda/inputOutput-mixed.part.bpmn +0 -13
  41. package/test/fixtures/bpmn/extension/camunda/inputOutput-plain.part.bpmn +0 -3
  42. package/test/fixtures/bpmn/extension/camunda/inputOutput-script.part.bpmn +0 -9
  43. package/test/fixtures/bpmn/extension/camunda/inputOutput.bpmn +0 -22
  44. package/test/fixtures/bpmn/extension/drools.part.bpmn +0 -9
  45. package/test/fixtures/bpmn/extension-attributes.bpmn +0 -20
  46. package/test/fixtures/bpmn/extension-elements.bpmn +0 -9
  47. package/test/fixtures/bpmn/inputOutputSpecification-children.bpmn +0 -19
  48. package/test/fixtures/bpmn/interface-implementationRef.part.bpmn +0 -2
  49. package/test/fixtures/bpmn/itemDefinition-structureRef.part.bpmn +0 -2
  50. package/test/fixtures/bpmn/lane-childLaneSets.part.bpmn +0 -8
  51. package/test/fixtures/bpmn/lane-children.bpmn +0 -46
  52. package/test/fixtures/bpmn/multiInstanceLoopCharacteristics-completionCondition.part.bpmn +0 -5
  53. package/test/fixtures/bpmn/multiInstanceLoopCharacteristics.bpmn +0 -181
  54. package/test/fixtures/bpmn/operation-implementationRef.part.bpmn +0 -2
  55. package/test/fixtures/bpmn/operation-messageRef.bpmn +0 -12
  56. package/test/fixtures/bpmn/participant-interfaceRef.bpmn +0 -20
  57. package/test/fixtures/bpmn/potentialOwner.bpmn +0 -11
  58. package/test/fixtures/bpmn/process-children.bpmn +0 -24
  59. package/test/fixtures/bpmn/scriptTask-script.part.bpmn +0 -4
  60. package/test/fixtures/bpmn/sequenceFlow-conditionExpression.part.bpmn +0 -5
  61. package/test/fixtures/bpmn/simple-default-ns.bpmn +0 -31
  62. package/test/fixtures/bpmn/simple.bpmn +0 -31
  63. package/test/fixtures/bpmn/sub-process-flow-nodes.part.bpmn +0 -8
  64. package/test/fixtures/bpmn/sub-process.part.bpmn +0 -10
  65. package/test/fixtures/bpmn/subprocess-flow-nodes-outgoing.part.bpmn +0 -16
  66. package/test/fixtures/bpmn/throw-event-dataInputAssociations.part.bpmn +0 -5
  67. package/test/fixtures/bpmn/timerEventDefinition.part.bpmn +0 -5
  68. package/test/fixtures/bpmn/vendor/signavio-complex-no-extensions.bpmn +0 -2151
  69. package/test/fixtures/bpmn/vendor/yaoqiang-event-definitions.bpmn +0 -396
  70. package/test/fixtures/bpmn/vendor.xsd +0 -14
  71. package/test/fixtures/bpmn/xsi-type.bpmn +0 -61
  72. package/test/fixtures/json/model/camunda.json +0 -224
  73. package/test/fixtures/json/model/drools.json +0 -24
  74. package/test/fixtures/xsd/BPMN20.xsd +0 -39
  75. package/test/fixtures/xsd/Vendor.xsd +0 -14
  76. package/test/helper.js +0 -23
  77. package/test/integration/camunda/read.js +0 -203
  78. package/test/integration/camunda/roundtrip.js +0 -48
  79. package/test/integration/camunda/write.js +0 -249
  80. package/test/integration/misc.js +0 -107
  81. package/test/matchers.js +0 -19
  82. package/test/spec/adapter/cmof/builder.js +0 -194
  83. package/test/spec/adapter/cmof/generate-simple.js +0 -560
  84. package/test/spec/bpmn-moddle.js +0 -208
  85. package/test/spec/xml/edit.js +0 -76
  86. package/test/spec/xml/read.js +0 -986
  87. package/test/spec/xml/roundtrip.js +0 -540
  88. package/test/spec/xml/write.js +0 -980
  89. package/test/xml-helper.js +0 -39
@@ -1,540 +0,0 @@
1
- 'use strict';
2
-
3
- var Helper = require('../../helper'),
4
- XMLHelper = require('../../xml-helper');
5
-
6
- var toXML = XMLHelper.toXML,
7
- validate = XMLHelper.validate;
8
-
9
-
10
- describe('bpmn-moddle - roundtrip', function() {
11
-
12
- var moddle = Helper.createModdle();
13
-
14
- function fromFile(file, done) {
15
- XMLHelper.fromFile(moddle, file, done);
16
- }
17
-
18
-
19
- describe('should serialize valid BPMN 2.0 xml after read', function() {
20
-
21
- this.timeout(15000);
22
-
23
-
24
- it('home-made bpmn model', function(done) {
25
-
26
- var definitions = moddle.create('bpmn:Definitions', { targetNamespace: 'http://foo' });
27
-
28
- var processElement = moddle.create('bpmn:Process');
29
- var serviceTask = moddle.create('bpmn:ServiceTask', { name: 'MyService Task' });
30
-
31
- processElement.get('flowElements').push(serviceTask);
32
- definitions.get('rootElements').push(processElement);
33
-
34
- // when
35
- toXML(definitions, { format: true }, function(err, xml) {
36
-
37
- // then
38
- validate(err, xml, done);
39
- });
40
- });
41
-
42
-
43
- it('obscure ids model', function(done) {
44
-
45
- var definitions = moddle.create('bpmn:Definitions', {
46
- 'xmlns:foo': 'http://foo-ns',
47
- targetNamespace: 'http://foo',
48
- rootElements: [
49
- moddle.create('bpmn:Message', { id: 'foo_bar' }),
50
- moddle.create('bpmn:Message', { id: 'foo-bar' }),
51
- moddle.create('bpmn:Message', { id: 'foo1bar' }),
52
- moddle.create('bpmn:Message', { id: 'Foo1bar' }),
53
- moddle.create('bpmn:Message', { id: '_foo_bar' }),
54
- moddle.create('bpmn:Message', { id: '_foo-bar' }),
55
- moddle.create('bpmn:Message', { id: '_11' })
56
- // invalid
57
- // moddle.create('bpmn:Message', { id: '-foo-bar' }),
58
- // moddle.create('bpmn:Message', { id: 'foo:_foo_bar' }),
59
- // moddle.create('bpmn:Message', { id: '1foo_bar' })
60
- ]
61
- });
62
-
63
- // when
64
- toXML(definitions, { format: true }, function(err, xml) {
65
-
66
- // then
67
- validate(err, xml, done);
68
- });
69
- });
70
-
71
-
72
- it('ioSpecification', function(done) {
73
-
74
- // given
75
- var definitions = moddle.create('bpmn:Definitions', { targetNamespace: 'http://foo' });
76
-
77
- var processElement = moddle.create('bpmn:Process');
78
-
79
- var dataInput = moddle.create('bpmn:DataInput', { id: 'DataInput_FOO' });
80
-
81
- var inputSet = moddle.create('bpmn:InputSet', {
82
- dataInputRefs: [ dataInput ]
83
- });
84
-
85
- var outputSet = moddle.create('bpmn:OutputSet');
86
-
87
- var ioSpecification = moddle.create('bpmn:InputOutputSpecification', {
88
- inputSets: [ inputSet ],
89
- outputSets: [ outputSet ],
90
- dataInputs: [ dataInput ]
91
- });
92
-
93
- var serviceTask = moddle.create('bpmn:ServiceTask', {
94
- name: 'MyService Task',
95
- ioSpecification: ioSpecification
96
- });
97
-
98
- processElement.get('flowElements').push(serviceTask);
99
- definitions.get('rootElements').push(processElement);
100
-
101
- // when
102
- toXML(definitions, { format: true }, function(err, xml) {
103
-
104
- // then
105
- validate(err, xml, done);
106
- });
107
- });
108
-
109
-
110
- it('properties', function(done) {
111
-
112
- // given
113
- var definitions = moddle.create('bpmn:Definitions', { targetNamespace: 'http://foo' });
114
-
115
- var processElement = moddle.create('bpmn:Process');
116
-
117
- var property = moddle.create('bpmn:Property', {
118
- id: 'Property_112',
119
- name: '__targetRef_placeholder'
120
- });
121
-
122
- var serviceTask = moddle.create('bpmn:ServiceTask', {
123
- name: 'MyService Task',
124
- properties: [ property ]
125
- });
126
-
127
- processElement.get('flowElements').push(serviceTask);
128
- definitions.get('rootElements').push(processElement);
129
-
130
- // when
131
- toXML(definitions, { format: true }, function(err, xml) {
132
-
133
- // then
134
- validate(err, xml, done);
135
- });
136
- });
137
-
138
-
139
- it('extension attributes', function(done) {
140
-
141
- // given
142
- fromFile('test/fixtures/bpmn/extension-attributes.bpmn', function(err, result) {
143
-
144
- if (err) {
145
- return done(err);
146
- }
147
-
148
- // when
149
- toXML(result, { format: true }, function(err, xml) {
150
- validate(err, xml, done);
151
- });
152
- });
153
- });
154
-
155
-
156
- it('multi instance loop characteristics', function(done) {
157
-
158
- // given
159
- fromFile('test/fixtures/bpmn/multiInstanceLoopCharacteristics.bpmn', function(err, result) {
160
-
161
- if (err) {
162
- return done(err);
163
- }
164
-
165
- // when
166
- toXML(result, { format: true }, function(err, xml) {
167
- validate(err, xml, done);
168
- });
169
- });
170
- });
171
-
172
-
173
- it('Expression without xsi:type', function(done) {
174
-
175
- // given
176
- fromFile('test/fixtures/bpmn/expression-plain.bpmn', function(err, result) {
177
-
178
- if (err) {
179
- return done(err);
180
- }
181
-
182
- // when
183
- toXML(result, { format: true }, function(err, xml) {
184
-
185
- if (err) {
186
- return done(err);
187
- }
188
-
189
- // we are serializing xsi:type, even though
190
- // it is the default
191
- expect(xml).to.contain('xsi:type="bpmn:tExpression');
192
-
193
- validate(err, xml, done);
194
- });
195
- });
196
-
197
- });
198
-
199
-
200
- it('documentation / extensionElements order', function(done) {
201
-
202
- // given
203
- fromFile('test/fixtures/bpmn/documentation-extension-elements.bpmn', function(err, result) {
204
-
205
- if (err) {
206
- return done(err);
207
- }
208
-
209
- // when
210
- toXML(result, { format: true }, function(err, xml) {
211
- validate(err, xml, done);
212
- });
213
- });
214
- });
215
-
216
-
217
- it('activity children order', function(done) {
218
-
219
- // given
220
- fromFile('test/fixtures/bpmn/activity-children.bpmn', function(err, result) {
221
-
222
- if (err) {
223
- return done(err);
224
- }
225
-
226
- // when
227
- toXML(result, { format: true }, function(err, xml) {
228
- validate(err, xml, done);
229
- });
230
- });
231
- });
232
-
233
-
234
- it('lane children order', function(done) {
235
-
236
- // given
237
- fromFile('test/fixtures/bpmn/lane-children.bpmn', function(err, result) {
238
-
239
- if (err) {
240
- return done(err);
241
- }
242
-
243
- // when
244
- toXML(result, { format: true }, function(err, xml) {
245
- validate(err, xml, done);
246
- });
247
- });
248
- });
249
-
250
-
251
- it('conversation children order', function(done) {
252
-
253
- // given
254
- fromFile('test/fixtures/bpmn/conversation-children.bpmn', function(err, result) {
255
-
256
- if (err) {
257
- return done(err);
258
- }
259
-
260
- // when
261
- toXML(result, { format: true }, function(err, xml) {
262
- validate(err, xml, done);
263
- });
264
- });
265
- });
266
-
267
-
268
- it('process children order', function(done) {
269
-
270
- // given
271
- fromFile('test/fixtures/bpmn/process-children.bpmn', function(err, result) {
272
-
273
- if (err) {
274
- return done(err);
275
- }
276
-
277
- // when
278
- toXML(result, { format: true }, function(err, xml) {
279
- validate(err, xml, done);
280
- });
281
- });
282
- });
283
-
284
-
285
- it('definitions children order', function(done) {
286
-
287
- // given
288
- fromFile('test/fixtures/bpmn/definitions-children.bpmn', function(err, result) {
289
-
290
- if (err) {
291
- return done(err);
292
- }
293
-
294
- // when
295
- toXML(result, { format: true }, function(err, xml) {
296
- validate(err, xml, done);
297
- });
298
- });
299
- });
300
-
301
-
302
- it('ioSpecification children order', function(done) {
303
-
304
- // given
305
- fromFile('test/fixtures/bpmn/inputOutputSpecification-children.bpmn', function(err, result) {
306
-
307
- if (err) {
308
- return done(err);
309
- }
310
-
311
- // when
312
- toXML(result, { format: true }, function(err, xml) {
313
- validate(err, xml, done);
314
- });
315
- });
316
- });
317
-
318
-
319
- it('Participant#interfaceRef', function(done) {
320
-
321
- // given
322
- fromFile('test/fixtures/bpmn/participant-interfaceRef.bpmn', function(err, result) {
323
-
324
- if (err) {
325
- return done(err);
326
- }
327
-
328
- // when
329
- toXML(result, { format: true }, function(err, xml) {
330
- validate(err, xml, done);
331
- });
332
- });
333
- });
334
-
335
-
336
- it('ResourceRole#resourceRef', function(done) {
337
-
338
- // given
339
- fromFile('test/fixtures/bpmn/potentialOwner.bpmn', function(err, result) {
340
-
341
- if (err) {
342
- return done(err);
343
- }
344
-
345
- // when
346
- toXML(result, { format: true }, function(err, xml) {
347
- validate(err, xml, done);
348
- });
349
- });
350
- });
351
-
352
-
353
- it('Operation#messageRef', function(done) {
354
-
355
- // given
356
- fromFile('test/fixtures/bpmn/operation-messageRef.bpmn', function(err, result) {
357
-
358
- if (err) {
359
- return done(err);
360
- }
361
-
362
- // when
363
- toXML(result, { format: true }, function(err, xml) {
364
-
365
- // then
366
- expect(xml).to.contain('<bpmn:inMessageRef>fooInMessage</bpmn:inMessageRef>');
367
-
368
- validate(err, xml, done);
369
- });
370
- });
371
- });
372
-
373
-
374
- it('di extensions', function(done) {
375
-
376
- // given
377
- fromFile('test/fixtures/bpmn/di-extension.bpmn', function(err, result) {
378
-
379
- if (err) {
380
- return done(err);
381
- }
382
-
383
- // when
384
- toXML(result, { format: true }, function(err, xml) {
385
-
386
- expect(xml).to.contain('<vendor:baz baz="BAZ" />');
387
- expect(xml).to.contain('<vendor:bar>BAR</vendor:bar>');
388
- expect(xml).to.contain('<di:extension />');
389
-
390
- validate(err, xml, done);
391
- });
392
- });
393
- });
394
-
395
-
396
- it('complex processElement / extensionElements', function(done) {
397
-
398
- // given
399
- fromFile('test/fixtures/bpmn/complex.bpmn', function(err, result) {
400
-
401
- if (err) {
402
- return done(err);
403
- }
404
-
405
- // when
406
- toXML(result, { format: true }, function(err, xml) {
407
- validate(err, xml, done);
408
- });
409
- });
410
- });
411
-
412
-
413
- it('category', function(done) {
414
-
415
- // given
416
- fromFile('test/fixtures/bpmn/category.bpmn', function(err, result) {
417
-
418
- if (err) {
419
- return done(err);
420
- }
421
-
422
- // when
423
- toXML(result, { format: true }, function(err, xml) {
424
-
425
- expect(xml).to.contain('sid-afd7e63e-916e-4bd0-a9f0-98cbff749193');
426
- expect(xml).to.contain('group with label');
427
-
428
- validate(err, xml, done);
429
- });
430
- });
431
-
432
- });
433
-
434
-
435
- it('simple processElement', function(done) {
436
-
437
- // given
438
- fromFile('test/fixtures/bpmn/simple.bpmn', function(err, result) {
439
-
440
- if (err) {
441
- return done(err);
442
- }
443
-
444
- // when
445
- toXML(result, { format: true }, function(err, xml) {
446
- validate(err, xml, done);
447
- });
448
- });
449
- });
450
-
451
-
452
- it('xsi:type', function(done) {
453
-
454
- // given
455
- fromFile('test/fixtures/bpmn/xsi-type.bpmn', function(err, result) {
456
-
457
- if (err) {
458
- return done(err);
459
- }
460
-
461
- // when
462
- toXML(result, { format: true }, function(err, xml) {
463
- validate(err, xml, done);
464
- });
465
- });
466
- });
467
-
468
- it('colors', function(done) {
469
-
470
- fromFile('test/fixtures/bpmn/example-colors.bpmn', function(err, result) {
471
-
472
- if (err) {
473
- return done(err);
474
- }
475
-
476
- // when
477
- toXML(result, { format: true }, function(err, xml) {
478
-
479
- validate(err, xml, done);
480
- });
481
- });
482
- });
483
-
484
- });
485
-
486
-
487
- describe('vendor', function() {
488
-
489
- describe('signavio', function() {
490
-
491
- it('complex processElement', function(done) {
492
-
493
- // given
494
- fromFile('test/fixtures/bpmn/vendor/signavio-complex-no-extensions.bpmn', function(err, result) {
495
-
496
- if (err) {
497
- return done(err);
498
- }
499
-
500
- // when
501
- toXML(result, { format: true }, function(err, xml) {
502
- validate(err, xml, done);
503
- });
504
- });
505
- });
506
-
507
- });
508
-
509
-
510
- describe('yaoqiang', function() {
511
-
512
- it('event definitions', function(done) {
513
-
514
- // given
515
- fromFile('test/fixtures/bpmn/vendor/yaoqiang-event-definitions.bpmn', function(err, result, context) {
516
-
517
- if (err) {
518
- return done(err);
519
- }
520
-
521
- var warningsStr = context.warnings.map(function(w) {
522
- return '\n\t- ' + w.message;
523
- }).join('');
524
-
525
- if (warningsStr) {
526
- return done(new Error('import warnings: ' + warningsStr));
527
- }
528
-
529
- // when
530
- toXML(result, { format: true }, function(err, xml) {
531
- validate(err, xml, done);
532
- });
533
- });
534
- });
535
-
536
- });
537
-
538
- });
539
-
540
- });