bpmn-moddle 0.12.3 → 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.
- package/.travis.yml +2 -5
- package/lib/simple.js +3 -2
- package/package.json +5 -5
- package/resources/bpmn/json/bpmn.json +9 -7
- package/resources/bpmn/json/bpmndi.json +1 -1
- package/resources/bpmn-io/json/bioc.json +41 -0
- package/.npmignore +0 -6
- package/test/expect.js +0 -7
- package/test/fixtures/bpmn/activity-children.bpmn +0 -23
- package/test/fixtures/bpmn/callActivity-calledElement.part.bpmn +0 -7
- package/test/fixtures/bpmn/catch-event-dataOutputAssociations.part.bpmn +0 -5
- package/test/fixtures/bpmn/category.bpmn +0 -28
- package/test/fixtures/bpmn/complex.bpmn +0 -3680
- package/test/fixtures/bpmn/conversation-children.bpmn +0 -23
- package/test/fixtures/bpmn/data-object-reference.bpmn +0 -17
- package/test/fixtures/bpmn/definitions-children.bpmn +0 -13
- package/test/fixtures/bpmn/di/bpmnDiagram-extension.part.bpmn +0 -17
- package/test/fixtures/bpmn/di/bpmnDiagram.part.bpmn +0 -12
- package/test/fixtures/bpmn/di/bpmnEdge-waypoint.part.bpmn +0 -4
- package/test/fixtures/bpmn/di/bpmnEdge.part.bpmn +0 -5
- package/test/fixtures/bpmn/di/bpmnShape.part.bpmn +0 -4
- package/test/fixtures/bpmn/di-extension.bpmn +0 -26
- package/test/fixtures/bpmn/documentation-extension-elements.bpmn +0 -15
- package/test/fixtures/bpmn/documentation.bpmn +0 -11
- package/test/fixtures/bpmn/empty-definitions-default-ns.bpmn +0 -4
- package/test/fixtures/bpmn/empty-definitions.bpmn +0 -5
- package/test/fixtures/bpmn/error/binary.png +0 -0
- package/test/fixtures/bpmn/error/categoryValue.bpmn +0 -27
- package/test/fixtures/bpmn/error/di-no-bpmn-element.bpmn +0 -13
- package/test/fixtures/bpmn/error/duplicate-ids.bpmn +0 -8
- package/test/fixtures/bpmn/error/extension-definition-missing.bpmn +0 -6
- package/test/fixtures/bpmn/error/no-xml.txt +0 -1
- package/test/fixtures/bpmn/error/undeclared-ns-child.bpmn +0 -6
- package/test/fixtures/bpmn/error/unrecognized-child.bpmn +0 -6
- package/test/fixtures/bpmn/escalation-error.bpmn +0 -6
- package/test/fixtures/bpmn/event-references.part.bpmn +0 -6
- package/test/fixtures/bpmn/extension/camunda/inputOutput-list.part.bpmn +0 -9
- package/test/fixtures/bpmn/extension/camunda/inputOutput-map.part.bpmn +0 -12
- package/test/fixtures/bpmn/extension/camunda/inputOutput-mixed.part.bpmn +0 -13
- package/test/fixtures/bpmn/extension/camunda/inputOutput-plain.part.bpmn +0 -3
- package/test/fixtures/bpmn/extension/camunda/inputOutput-script.part.bpmn +0 -9
- package/test/fixtures/bpmn/extension/camunda/inputOutput.bpmn +0 -22
- package/test/fixtures/bpmn/extension/drools.part.bpmn +0 -9
- package/test/fixtures/bpmn/extension-attributes.bpmn +0 -20
- package/test/fixtures/bpmn/extension-elements.bpmn +0 -9
- package/test/fixtures/bpmn/inputOutputSpecification-children.bpmn +0 -19
- package/test/fixtures/bpmn/interface-implementationRef.part.bpmn +0 -2
- package/test/fixtures/bpmn/itemDefinition-structureRef.part.bpmn +0 -2
- package/test/fixtures/bpmn/lane-childLaneSets.part.bpmn +0 -8
- package/test/fixtures/bpmn/lane-children.bpmn +0 -46
- package/test/fixtures/bpmn/multiInstanceLoopCharacteristics-completionCondition.part.bpmn +0 -5
- package/test/fixtures/bpmn/multiInstanceLoopCharacteristics.bpmn +0 -181
- package/test/fixtures/bpmn/operation-implementationRef.part.bpmn +0 -2
- package/test/fixtures/bpmn/operation-messageRef.bpmn +0 -12
- package/test/fixtures/bpmn/participant-interfaceRef.bpmn +0 -20
- package/test/fixtures/bpmn/potentialOwner.bpmn +0 -11
- package/test/fixtures/bpmn/process-children.bpmn +0 -24
- package/test/fixtures/bpmn/scriptTask-script.part.bpmn +0 -4
- package/test/fixtures/bpmn/sequenceFlow-conditionExpression.part.bpmn +0 -5
- package/test/fixtures/bpmn/simple-default-ns.bpmn +0 -31
- package/test/fixtures/bpmn/simple.bpmn +0 -31
- package/test/fixtures/bpmn/sub-process-flow-nodes.part.bpmn +0 -8
- package/test/fixtures/bpmn/sub-process.part.bpmn +0 -10
- package/test/fixtures/bpmn/subprocess-flow-nodes-outgoing.part.bpmn +0 -16
- package/test/fixtures/bpmn/throw-event-dataInputAssociations.part.bpmn +0 -5
- package/test/fixtures/bpmn/timerEventDefinition.part.bpmn +0 -5
- package/test/fixtures/bpmn/vendor/signavio-complex-no-extensions.bpmn +0 -2151
- package/test/fixtures/bpmn/vendor/yaoqiang-event-definitions.bpmn +0 -396
- package/test/fixtures/bpmn/vendor.xsd +0 -14
- package/test/fixtures/bpmn/xsi-type.bpmn +0 -61
- package/test/fixtures/json/model/camunda.json +0 -224
- package/test/fixtures/json/model/drools.json +0 -24
- package/test/fixtures/xsd/BPMN20.xsd +0 -39
- package/test/fixtures/xsd/Vendor.xsd +0 -14
- package/test/helper.js +0 -23
- package/test/integration/camunda/read.js +0 -203
- package/test/integration/camunda/roundtrip.js +0 -48
- package/test/integration/camunda/write.js +0 -249
- package/test/integration/misc.js +0 -107
- package/test/matchers.js +0 -19
- package/test/spec/adapter/cmof/builder.js +0 -194
- package/test/spec/adapter/cmof/generate-simple.js +0 -548
- package/test/spec/bpmn-moddle.js +0 -208
- package/test/spec/xml/edit.js +0 -76
- package/test/spec/xml/read.js +0 -986
- package/test/spec/xml/roundtrip.js +0 -497
- package/test/spec/xml/write.js +0 -927
- package/test/xml-helper.js +0 -39
package/test/spec/bpmn-moddle.js
DELETED
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var Helper = require('../helper');
|
|
4
|
-
|
|
5
|
-
var moddle = Helper.createModdle();
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
describe('bpmn-moddle', function() {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
describe('parsing', function() {
|
|
12
|
-
|
|
13
|
-
it('should publish type', function() {
|
|
14
|
-
// when
|
|
15
|
-
var type = moddle.getType('bpmn:Process');
|
|
16
|
-
|
|
17
|
-
// then
|
|
18
|
-
expect(type).to.exist;
|
|
19
|
-
expect(type.$descriptor).to.exist;
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
it('should redefine property', function() {
|
|
24
|
-
|
|
25
|
-
// when
|
|
26
|
-
var type = moddle.getType('bpmndi:BPMNShape');
|
|
27
|
-
|
|
28
|
-
// then
|
|
29
|
-
expect(type).to.exist;
|
|
30
|
-
|
|
31
|
-
var descriptor = type.$descriptor;
|
|
32
|
-
|
|
33
|
-
expect(descriptor).to.exist;
|
|
34
|
-
expect(descriptor.propertiesByName['di:modelElement']).to.eql(descriptor.propertiesByName['bpmndi:bpmnElement']);
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
describe('creation', function() {
|
|
41
|
-
|
|
42
|
-
it('should create SequenceFlow', function() {
|
|
43
|
-
var sequenceFlow = moddle.create('bpmn:SequenceFlow');
|
|
44
|
-
|
|
45
|
-
expect(sequenceFlow.$type).to.eql('bpmn:SequenceFlow');
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
it('should create Definitions', function() {
|
|
50
|
-
var definitions = moddle.create('bpmn:Definitions');
|
|
51
|
-
|
|
52
|
-
expect(definitions.$type).to.eql('bpmn:Definitions');
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
it('should create Process', function() {
|
|
57
|
-
var process = moddle.create('bpmn:Process');
|
|
58
|
-
|
|
59
|
-
expect(process.$type).to.eql('bpmn:Process');
|
|
60
|
-
expect(process.$instanceOf('bpmn:FlowElementsContainer')).to.be.true;
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
it('should create SubProcess', function() {
|
|
65
|
-
var subProcess = moddle.create('bpmn:SubProcess');
|
|
66
|
-
|
|
67
|
-
expect(subProcess.$type).to.eql('bpmn:SubProcess');
|
|
68
|
-
expect(subProcess.$instanceOf('bpmn:InteractionNode')).to.be.true;
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
describe('defaults', function() {
|
|
73
|
-
|
|
74
|
-
it('should init Gateway', function() {
|
|
75
|
-
var gateway = moddle.create('bpmn:Gateway');
|
|
76
|
-
|
|
77
|
-
expect(gateway.gatewayDirection).to.eql('Unspecified');
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
it('should init BPMNShape', function() {
|
|
82
|
-
var bpmnEdge = moddle.create('bpmndi:BPMNEdge');
|
|
83
|
-
|
|
84
|
-
expect(bpmnEdge.messageVisibleKind).to.eql('initiating');
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
it('should init EventBasedGateway', function() {
|
|
89
|
-
var gateway = moddle.create('bpmn:EventBasedGateway');
|
|
90
|
-
|
|
91
|
-
expect(gateway.eventGatewayType).to.eql('Exclusive');
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
it('should init CatchEvent', function() {
|
|
96
|
-
var event = moddle.create('bpmn:CatchEvent');
|
|
97
|
-
|
|
98
|
-
expect(event.parallelMultiple).to.eql(false);
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
it('should init ParticipantMultiplicity', function() {
|
|
103
|
-
var participantMultiplicity = moddle.create('bpmn:ParticipantMultiplicity');
|
|
104
|
-
|
|
105
|
-
expect(participantMultiplicity.minimum).to.eql(0);
|
|
106
|
-
expect(participantMultiplicity.maximum).to.eql(1);
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
it('should init Activity', function() {
|
|
111
|
-
var activity = moddle.create('bpmn:Activity');
|
|
112
|
-
|
|
113
|
-
expect(activity.startQuantity).to.eql(1);
|
|
114
|
-
expect(activity.completionQuantity).to.eql(1);
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
describe('property access', function() {
|
|
123
|
-
|
|
124
|
-
describe('singleton properties', function() {
|
|
125
|
-
|
|
126
|
-
it('should set attribute', function() {
|
|
127
|
-
|
|
128
|
-
// given
|
|
129
|
-
var process = moddle.create('bpmn:Process');
|
|
130
|
-
|
|
131
|
-
// assume
|
|
132
|
-
expect(process.get('isExecutable')).not.to.exist;
|
|
133
|
-
|
|
134
|
-
// when
|
|
135
|
-
process.set('isExecutable', true);
|
|
136
|
-
|
|
137
|
-
// then
|
|
138
|
-
expect(process).to.jsonEqual({
|
|
139
|
-
$type: 'bpmn:Process',
|
|
140
|
-
isExecutable: true
|
|
141
|
-
});
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
it('should set attribute (ns)', function() {
|
|
146
|
-
|
|
147
|
-
// given
|
|
148
|
-
var process = moddle.create('bpmn:Process');
|
|
149
|
-
|
|
150
|
-
// when
|
|
151
|
-
process.set('bpmn:isExecutable', true);
|
|
152
|
-
|
|
153
|
-
// then
|
|
154
|
-
expect(process).to.jsonEqual({
|
|
155
|
-
$type: 'bpmn:Process',
|
|
156
|
-
isExecutable: true
|
|
157
|
-
});
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
it('should set id attribute', function() {
|
|
162
|
-
|
|
163
|
-
// given
|
|
164
|
-
var definitions = moddle.create('bpmn:Definitions');
|
|
165
|
-
|
|
166
|
-
// when
|
|
167
|
-
definitions.set('id', 10);
|
|
168
|
-
|
|
169
|
-
// then
|
|
170
|
-
expect(definitions).to.jsonEqual({
|
|
171
|
-
$type: 'bpmn:Definitions',
|
|
172
|
-
id: 10
|
|
173
|
-
});
|
|
174
|
-
});
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
describe('builder', function() {
|
|
179
|
-
|
|
180
|
-
it('should create simple hierarchy', function() {
|
|
181
|
-
|
|
182
|
-
// given
|
|
183
|
-
var definitions = moddle.create('bpmn:Definitions');
|
|
184
|
-
var rootElements = definitions.get('bpmn:rootElements');
|
|
185
|
-
|
|
186
|
-
var process = moddle.create('bpmn:Process');
|
|
187
|
-
var collaboration = moddle.create('bpmn:Collaboration');
|
|
188
|
-
|
|
189
|
-
// when
|
|
190
|
-
rootElements.push(collaboration);
|
|
191
|
-
rootElements.push(process);
|
|
192
|
-
|
|
193
|
-
// then
|
|
194
|
-
expect(rootElements).to.eql([ collaboration, process ]);
|
|
195
|
-
expect(definitions.rootElements).to.eql([ collaboration, process ]);
|
|
196
|
-
|
|
197
|
-
expect(definitions).to.jsonEqual({
|
|
198
|
-
$type: 'bpmn:Definitions',
|
|
199
|
-
rootElements: [
|
|
200
|
-
{ $type: 'bpmn:Collaboration' },
|
|
201
|
-
{ $type: 'bpmn:Process' }
|
|
202
|
-
]
|
|
203
|
-
});
|
|
204
|
-
});
|
|
205
|
-
|
|
206
|
-
});
|
|
207
|
-
});
|
|
208
|
-
});
|
package/test/spec/xml/edit.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var XMLHelper = require('../../xml-helper'),
|
|
4
|
-
Helper = require('../../helper');
|
|
5
|
-
|
|
6
|
-
var toXML = XMLHelper.toXML;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
describe('bpmn-moddle - edit', function() {
|
|
10
|
-
|
|
11
|
-
var moddle = Helper.createModdle();
|
|
12
|
-
|
|
13
|
-
function fromFile(file, done) {
|
|
14
|
-
XMLHelper.fromFile(moddle, file, done);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
describe('save after change', function() {
|
|
19
|
-
|
|
20
|
-
it('should serialize changed name', function(done) {
|
|
21
|
-
|
|
22
|
-
// given
|
|
23
|
-
fromFile('test/fixtures/bpmn/simple.bpmn', function(err, result) {
|
|
24
|
-
|
|
25
|
-
if (err) {
|
|
26
|
-
return done(err);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
result.rootElements[0].name = 'OTHER PROCESS';
|
|
30
|
-
|
|
31
|
-
// when
|
|
32
|
-
toXML(result, { format: true }, function(err, xml) {
|
|
33
|
-
expect(xml).to.contain('name="OTHER PROCESS"');
|
|
34
|
-
|
|
35
|
-
done(err);
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
describe('dataObjectRef', function() {
|
|
45
|
-
|
|
46
|
-
it('should update', function(done) {
|
|
47
|
-
|
|
48
|
-
fromFile('test/fixtures/bpmn/data-object-reference.bpmn', function(err, result) {
|
|
49
|
-
|
|
50
|
-
// given
|
|
51
|
-
var process = result.rootElements[0],
|
|
52
|
-
dataObjectReference = process.flowElements[0];
|
|
53
|
-
|
|
54
|
-
// when
|
|
55
|
-
// creating new data object
|
|
56
|
-
var dataObject_2 = moddle.create('bpmn:DataObject', { id: 'dataObject_2' });
|
|
57
|
-
|
|
58
|
-
// adding data object to its parent (makes sure it is contained in the XML)
|
|
59
|
-
process.flowElements.push(dataObject_2);
|
|
60
|
-
|
|
61
|
-
// set reference to the new data object
|
|
62
|
-
dataObjectReference.dataObjectRef = dataObject_2;
|
|
63
|
-
|
|
64
|
-
toXML(result, { format: true }, function(err, xml) {
|
|
65
|
-
|
|
66
|
-
// then
|
|
67
|
-
expect(xml).to.contain('<bpmn:dataObject id="dataObject_2" />');
|
|
68
|
-
expect(xml).to.contain('<bpmn:dataObjectReference id="DataObjectReference_1" dataObjectRef="dataObject_2" />');
|
|
69
|
-
|
|
70
|
-
done(err);
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
});
|