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.
- package/.travis.yml +2 -5
- package/package.json +4 -4
- package/resources/bpmn/json/bpmn.json +1 -1
- package/resources/bpmn/json/bpmndi.json +1 -1
- package/resources/bpmn-io/json/bioc.json +1 -1
- 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/example-colors.bpmn +0 -40
- package/test/fixtures/bpmn/expression-plain.bpmn +0 -40
- 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 -560
- 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 -540
- package/test/spec/xml/write.js +0 -980
- package/test/xml-helper.js +0 -39
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "Camunda",
|
|
3
|
-
"uri": "http://activiti.org/bpmn",
|
|
4
|
-
"prefix": "camunda",
|
|
5
|
-
"xml": {
|
|
6
|
-
"tagAlias": "lowerCase"
|
|
7
|
-
},
|
|
8
|
-
"associations": [],
|
|
9
|
-
"types": [
|
|
10
|
-
{
|
|
11
|
-
"name": "AsyncCapable",
|
|
12
|
-
"isAbstract": true,
|
|
13
|
-
"extends": [
|
|
14
|
-
"bpmn:Activity",
|
|
15
|
-
"bpmn:Gateway",
|
|
16
|
-
"bpmn:Event"
|
|
17
|
-
],
|
|
18
|
-
"properties": [
|
|
19
|
-
{
|
|
20
|
-
"name": "asyncBefore",
|
|
21
|
-
"isAttr": true,
|
|
22
|
-
"type": "Boolean",
|
|
23
|
-
"default": false
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"name": "asyncAfter",
|
|
27
|
-
"isAttr": true,
|
|
28
|
-
"type": "Boolean",
|
|
29
|
-
"default": false
|
|
30
|
-
}
|
|
31
|
-
]
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"name": "Assignable",
|
|
35
|
-
"extends": [ "bpmn:UserTask" ],
|
|
36
|
-
"properties": [
|
|
37
|
-
{
|
|
38
|
-
"name": "assignee",
|
|
39
|
-
"isAttr": true,
|
|
40
|
-
"type": "String"
|
|
41
|
-
}
|
|
42
|
-
]
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"name": "Calling",
|
|
46
|
-
"extends": [ "bpmn:CallActivity" ],
|
|
47
|
-
"properties": [
|
|
48
|
-
{
|
|
49
|
-
"name": "calledElementBinding",
|
|
50
|
-
"isAttr": true,
|
|
51
|
-
"type": "String"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"name": "calledElementVersion",
|
|
55
|
-
"isAttr": true,
|
|
56
|
-
"type": "Integer"
|
|
57
|
-
}
|
|
58
|
-
]
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
"name": "ServiceTaskLike",
|
|
62
|
-
"extends": [
|
|
63
|
-
"bpmn:ServiceTask",
|
|
64
|
-
"bpmn:BusinessRuleTask",
|
|
65
|
-
"bpmn:SendTask",
|
|
66
|
-
"bpmn:MessageEventDefinition"
|
|
67
|
-
],
|
|
68
|
-
"properties": [
|
|
69
|
-
{
|
|
70
|
-
"name": "expression",
|
|
71
|
-
"isAttr": true,
|
|
72
|
-
"type": "String"
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"name": "javaDelegate",
|
|
76
|
-
"isAttr": true,
|
|
77
|
-
"type": "String"
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
"name": "delegateExpression",
|
|
81
|
-
"isAttr": true,
|
|
82
|
-
"type": "String"
|
|
83
|
-
}
|
|
84
|
-
]
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
"name": "Connector",
|
|
88
|
-
"superClass": [
|
|
89
|
-
"Element"
|
|
90
|
-
],
|
|
91
|
-
"properties": [
|
|
92
|
-
{
|
|
93
|
-
"name": "inputOutput",
|
|
94
|
-
"type": "InputOutput"
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
"name": "connectorId",
|
|
98
|
-
"type": "String"
|
|
99
|
-
}
|
|
100
|
-
]
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
"name": "InputOutput",
|
|
104
|
-
"superClass": [
|
|
105
|
-
"Element"
|
|
106
|
-
],
|
|
107
|
-
"properties": [
|
|
108
|
-
{
|
|
109
|
-
"name": "inputOutput",
|
|
110
|
-
"type": "InputOutput"
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
"name": "connectorId",
|
|
114
|
-
"type": "String"
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
"name": "inputParameters",
|
|
118
|
-
"isMany": true,
|
|
119
|
-
"type": "InputParameter"
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
"name": "outputParameters",
|
|
123
|
-
"isMany": true,
|
|
124
|
-
"type": "OutputParameter"
|
|
125
|
-
}
|
|
126
|
-
]
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
"name": "InputOutputParameter",
|
|
130
|
-
"properties": [
|
|
131
|
-
{
|
|
132
|
-
"name": "name",
|
|
133
|
-
"isAttr": true,
|
|
134
|
-
"type": "String"
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
"name": "value",
|
|
138
|
-
"isBody": true,
|
|
139
|
-
"type": "String"
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
"name": "definition",
|
|
143
|
-
"type": "InputOutputParameterDefinition"
|
|
144
|
-
}
|
|
145
|
-
]
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
"name": "InputOutputParameterDefinition",
|
|
149
|
-
"isAbstract": true
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
"name": "List",
|
|
153
|
-
"superClass": [ "InputOutputParameterDefinition" ],
|
|
154
|
-
"properties": [
|
|
155
|
-
{
|
|
156
|
-
"name": "items",
|
|
157
|
-
"isMany": true,
|
|
158
|
-
"type": "InputOutputParameterDefinition"
|
|
159
|
-
}
|
|
160
|
-
]
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
"name": "Map",
|
|
164
|
-
"superClass": [ "InputOutputParameterDefinition" ],
|
|
165
|
-
"properties": [
|
|
166
|
-
{
|
|
167
|
-
"name": "entries",
|
|
168
|
-
"isMany": true,
|
|
169
|
-
"type": "Entry"
|
|
170
|
-
}
|
|
171
|
-
]
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
"name": "Entry",
|
|
175
|
-
"properties": [
|
|
176
|
-
{
|
|
177
|
-
"name": "key",
|
|
178
|
-
"isAttr": true,
|
|
179
|
-
"type": "String"
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
"name": "value",
|
|
183
|
-
"type": "InputOutputParameterDefinition"
|
|
184
|
-
}
|
|
185
|
-
]
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
"name": "Value",
|
|
189
|
-
"superClass": [ "InputOutputParameterDefinition" ],
|
|
190
|
-
"properties": [
|
|
191
|
-
{
|
|
192
|
-
"name": "value",
|
|
193
|
-
"isBody": true,
|
|
194
|
-
"type": "String"
|
|
195
|
-
}
|
|
196
|
-
]
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
"name": "Script",
|
|
200
|
-
"superClass": [ "InputOutputParameterDefinition" ],
|
|
201
|
-
"properties": [
|
|
202
|
-
{
|
|
203
|
-
"name": "scriptLanguage",
|
|
204
|
-
"isAttr": true,
|
|
205
|
-
"type": "String"
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
"name": "source",
|
|
209
|
-
"isBody": true,
|
|
210
|
-
"type": "String"
|
|
211
|
-
}
|
|
212
|
-
]
|
|
213
|
-
},
|
|
214
|
-
{
|
|
215
|
-
"name": "InputParameter",
|
|
216
|
-
"superClass": [ "InputOutputParameter" ]
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
"name": "OutputParameter",
|
|
220
|
-
"superClass": [ "InputOutputParameter" ]
|
|
221
|
-
}
|
|
222
|
-
],
|
|
223
|
-
"emumerations": [ ]
|
|
224
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "DROOLS",
|
|
3
|
-
"uri": "http://www.jboss.org/drools",
|
|
4
|
-
"prefix": "drools",
|
|
5
|
-
"xml": {
|
|
6
|
-
"tagAlias": "lowerCase"
|
|
7
|
-
},
|
|
8
|
-
"associations": [],
|
|
9
|
-
"types": [
|
|
10
|
-
{
|
|
11
|
-
"name": "Import",
|
|
12
|
-
"superClass": [
|
|
13
|
-
"Element"
|
|
14
|
-
],
|
|
15
|
-
"properties": [
|
|
16
|
-
{
|
|
17
|
-
"name": "name",
|
|
18
|
-
"type": "String",
|
|
19
|
-
"isAttr": true
|
|
20
|
-
}
|
|
21
|
-
]
|
|
22
|
-
}
|
|
23
|
-
]
|
|
24
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<xsd:schema elementFormDefault="qualified" attributeFormDefault="unqualified"
|
|
3
|
-
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
|
|
4
|
-
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
|
5
|
-
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
|
|
6
|
-
xmlns:vendor="http://vendor"
|
|
7
|
-
targetNamespace="http://www.omg.org/spec/BPMN/20100524/MODEL">
|
|
8
|
-
|
|
9
|
-
<xsd:import namespace="http://www.omg.org/spec/BPMN/20100524/DI" schemaLocation="../../../resources/bpmn/xsd/BPMNDI.xsd"/>
|
|
10
|
-
<xsd:import namespace="http://vendor" schemaLocation="Vendor.xsd"/>
|
|
11
|
-
<xsd:include schemaLocation="../../../resources/bpmn/xsd/Semantic.xsd"/>
|
|
12
|
-
|
|
13
|
-
<xsd:element name="definitions" type="tDefinitions"/>
|
|
14
|
-
<xsd:complexType name="tDefinitions">
|
|
15
|
-
<xsd:sequence>
|
|
16
|
-
<xsd:element ref="import" minOccurs="0" maxOccurs="unbounded"/>
|
|
17
|
-
<xsd:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>
|
|
18
|
-
<xsd:element ref="rootElement" minOccurs="0" maxOccurs="unbounded"/>
|
|
19
|
-
<xsd:element ref="bpmndi:BPMNDiagram" minOccurs="0" maxOccurs="unbounded"/>
|
|
20
|
-
<xsd:element ref="relationship" minOccurs="0" maxOccurs="unbounded"/>
|
|
21
|
-
</xsd:sequence>
|
|
22
|
-
<xsd:attribute name="id" type="xsd:ID" use="optional"/>
|
|
23
|
-
<xsd:attribute name="name" type="xsd:string"/>
|
|
24
|
-
<xsd:attribute name="targetNamespace" type="xsd:anyURI" use="required"/>
|
|
25
|
-
<xsd:attribute name="expressionLanguage" type="xsd:anyURI" use="optional" default="http://www.w3.org/1999/XPath"/>
|
|
26
|
-
<xsd:attribute name="typeLanguage" type="xsd:anyURI" use="optional" default="http://www.w3.org/2001/XMLSchema"/>
|
|
27
|
-
<xsd:attribute name="exporter" type="xsd:string"/>
|
|
28
|
-
<xsd:attribute name="exporterVersion" type="xsd:string"/>
|
|
29
|
-
<xsd:anyAttribute namespace="##other" processContents="lax"/>
|
|
30
|
-
</xsd:complexType>
|
|
31
|
-
|
|
32
|
-
<xsd:element name="import" type="tImport"/>
|
|
33
|
-
<xsd:complexType name="tImport">
|
|
34
|
-
<xsd:attribute name="namespace" type="xsd:anyURI" use="required"/>
|
|
35
|
-
<xsd:attribute name="location" type="xsd:string" use="required"/>
|
|
36
|
-
<xsd:attribute name="importType" type="xsd:anyURI" use="required"/>
|
|
37
|
-
</xsd:complexType>
|
|
38
|
-
|
|
39
|
-
</xsd:schema>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<xsd:schema elementFormDefault="qualified" attributeFormDefault="unqualified"
|
|
3
|
-
xmlns="http://vendor"
|
|
4
|
-
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
|
5
|
-
targetNamespace="http://vendor">
|
|
6
|
-
|
|
7
|
-
<xsd:element name="baz" type="tBaz" />
|
|
8
|
-
<xsd:complexType name="tBaz">
|
|
9
|
-
<xsd:attribute name="baz" type="xsd:string"/>
|
|
10
|
-
</xsd:complexType>
|
|
11
|
-
|
|
12
|
-
<xsd:element name="bar" type="tBar" />
|
|
13
|
-
<xsd:complexType name="tBar" mixed="true"></xsd:complexType>
|
|
14
|
-
</xsd:schema>
|
package/test/helper.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var fs = require('fs');
|
|
4
|
-
|
|
5
|
-
var SimpleBpmnModdle = require('../');
|
|
6
|
-
|
|
7
|
-
function ensureDirExists(dir) {
|
|
8
|
-
|
|
9
|
-
if (!fs.existsSync(dir)) {
|
|
10
|
-
fs.mkdirSync(dir);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function readFile(filename) {
|
|
15
|
-
return fs.readFileSync(filename, { encoding: 'UTF-8' });
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
module.exports.readFile = readFile;
|
|
19
|
-
module.exports.ensureDirExists = ensureDirExists;
|
|
20
|
-
|
|
21
|
-
module.exports.createModdle = function(additionalPackages, options) {
|
|
22
|
-
return new SimpleBpmnModdle(additionalPackages, options);
|
|
23
|
-
};
|
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var os = require('os');
|
|
4
|
-
|
|
5
|
-
var Helper = require('../../helper');
|
|
6
|
-
|
|
7
|
-
var camundaPackage = require('../../fixtures/json/model/camunda');
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
describe('bpmn-moddle - integration', function() {
|
|
11
|
-
|
|
12
|
-
describe('camunda extension', function() {
|
|
13
|
-
|
|
14
|
-
describe('read', function() {
|
|
15
|
-
|
|
16
|
-
var moddle = Helper.createModdle({ camunda: camundaPackage });
|
|
17
|
-
|
|
18
|
-
function read(xml, root, opts, callback) {
|
|
19
|
-
return moddle.fromXML(xml, root, opts, callback);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function fromFile(file, root, opts, callback) {
|
|
23
|
-
var contents = Helper.readFile('test/fixtures/bpmn/' + file);
|
|
24
|
-
return read(contents, root, opts, callback);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
describe('should recognize camunda types', function() {
|
|
29
|
-
|
|
30
|
-
it('InputOutput - list', function(done) {
|
|
31
|
-
|
|
32
|
-
// given
|
|
33
|
-
|
|
34
|
-
// when
|
|
35
|
-
fromFile('extension/camunda/inputOutput-list.part.bpmn', 'camunda:InputOutput', function(err, result) {
|
|
36
|
-
|
|
37
|
-
var expected = {
|
|
38
|
-
$type: 'camunda:InputOutput',
|
|
39
|
-
outputParameters: [
|
|
40
|
-
{
|
|
41
|
-
$type: 'camunda:OutputParameter',
|
|
42
|
-
name: 'var1',
|
|
43
|
-
definition: {
|
|
44
|
-
$type: 'camunda:List',
|
|
45
|
-
items: [
|
|
46
|
-
{ $type: 'camunda:Value', value: '${1+1}' },
|
|
47
|
-
{ $type: 'camunda:Value', value: '${1+2}' },
|
|
48
|
-
{ $type: 'camunda:Value', value: '${1+3}' }
|
|
49
|
-
]
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
]
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
// then
|
|
56
|
-
expect(result).to.jsonEqual(expected);
|
|
57
|
-
|
|
58
|
-
done(err);
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
it('InputOutput - map', function(done) {
|
|
64
|
-
|
|
65
|
-
// given
|
|
66
|
-
|
|
67
|
-
// when
|
|
68
|
-
fromFile('extension/camunda/inputOutput-map.part.bpmn', 'camunda:InputOutput', function(err, result) {
|
|
69
|
-
|
|
70
|
-
var expected = {
|
|
71
|
-
$type: 'camunda:InputOutput',
|
|
72
|
-
inputParameters: [
|
|
73
|
-
{
|
|
74
|
-
$type: 'camunda:InputParameter',
|
|
75
|
-
name: 'var1',
|
|
76
|
-
definition: {
|
|
77
|
-
$type: 'camunda:Map',
|
|
78
|
-
entries: [
|
|
79
|
-
{
|
|
80
|
-
$type: 'camunda:Entry',
|
|
81
|
-
key: 'a',
|
|
82
|
-
value: {
|
|
83
|
-
$type: 'camunda:List',
|
|
84
|
-
items: [
|
|
85
|
-
{
|
|
86
|
-
$type: 'camunda:Value',
|
|
87
|
-
value: 'stringInListNestedInMap'
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
$type: 'camunda:Value',
|
|
91
|
-
value: '${ \'b\' }'
|
|
92
|
-
}
|
|
93
|
-
]
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
]
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
]
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
// then
|
|
103
|
-
expect(result).to.jsonEqual(expected);
|
|
104
|
-
|
|
105
|
-
done(err);
|
|
106
|
-
});
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
it('InputOutput - mixed', function(done) {
|
|
111
|
-
|
|
112
|
-
// when
|
|
113
|
-
fromFile('extension/camunda/inputOutput-mixed.part.bpmn', 'camunda:InputOutput', function(err, result) {
|
|
114
|
-
|
|
115
|
-
var expected = {
|
|
116
|
-
$type: 'camunda:InputOutput',
|
|
117
|
-
inputParameters: [
|
|
118
|
-
{
|
|
119
|
-
$type: 'camunda:InputParameter',
|
|
120
|
-
name: 'var1',
|
|
121
|
-
definition: {
|
|
122
|
-
$type: 'camunda:List',
|
|
123
|
-
items: [
|
|
124
|
-
{ $type: 'camunda:Value', value: 'constantStringValue' },
|
|
125
|
-
{ $type: 'camunda:Value', value: '${ \'elValue\' }' },
|
|
126
|
-
{
|
|
127
|
-
$type: 'camunda:Script',
|
|
128
|
-
source: '\n return "scriptValue";\n '
|
|
129
|
-
}
|
|
130
|
-
]
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
]
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
// then
|
|
137
|
-
expect(result).to.jsonEqual(expected);
|
|
138
|
-
|
|
139
|
-
done(err);
|
|
140
|
-
});
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
it('InputOutput - plain', function(done) {
|
|
145
|
-
|
|
146
|
-
// given
|
|
147
|
-
|
|
148
|
-
// when
|
|
149
|
-
fromFile('extension/camunda/inputOutput-plain.part.bpmn', 'camunda:InputOutput', function(err, result) {
|
|
150
|
-
|
|
151
|
-
var expected = {
|
|
152
|
-
$type: 'camunda:InputOutput',
|
|
153
|
-
inputParameters: [
|
|
154
|
-
{
|
|
155
|
-
$type: 'camunda:InputParameter',
|
|
156
|
-
name: 'var2',
|
|
157
|
-
value: 'stringConstantValue'
|
|
158
|
-
}
|
|
159
|
-
]
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
// then
|
|
163
|
-
expect(result).to.jsonEqual(expected);
|
|
164
|
-
|
|
165
|
-
done(err);
|
|
166
|
-
});
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
it('InputOutput - script', function(done) {
|
|
171
|
-
|
|
172
|
-
// given
|
|
173
|
-
|
|
174
|
-
// when
|
|
175
|
-
fromFile('extension/camunda/inputOutput-script.part.bpmn', 'camunda:InputOutput', function(err, result) {
|
|
176
|
-
|
|
177
|
-
var expected = {
|
|
178
|
-
$type: 'camunda:InputOutput',
|
|
179
|
-
outputParameters: [
|
|
180
|
-
{
|
|
181
|
-
$type: 'camunda:OutputParameter',
|
|
182
|
-
name: 'var1',
|
|
183
|
-
definition: {
|
|
184
|
-
$type: 'camunda:Script',
|
|
185
|
-
source: '\n return 1 + 1;\n '
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
]
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
// then
|
|
192
|
-
expect(result).to.jsonEqual(expected);
|
|
193
|
-
|
|
194
|
-
done(err);
|
|
195
|
-
});
|
|
196
|
-
});
|
|
197
|
-
});
|
|
198
|
-
|
|
199
|
-
});
|
|
200
|
-
|
|
201
|
-
});
|
|
202
|
-
|
|
203
|
-
});
|
|
@@ -1,48 +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
|
-
var camundaPackage = require('../../fixtures/json/model/camunda');
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
describe('bpmn-moddle - integration', function() {
|
|
13
|
-
|
|
14
|
-
describe('camunda extension', function() {
|
|
15
|
-
|
|
16
|
-
var moddle = Helper.createModdle({ camunda: camundaPackage });
|
|
17
|
-
|
|
18
|
-
function fromFile(file, done) {
|
|
19
|
-
XMLHelper.fromFile(moddle, file, done);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
describe('should serialize valid BPMN 2.0 after read', function() {
|
|
24
|
-
|
|
25
|
-
this.timeout(15000);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
it('inputOutput', function(done) {
|
|
29
|
-
|
|
30
|
-
// given
|
|
31
|
-
fromFile('test/fixtures/bpmn/extension/camunda/inputOutput.bpmn', function(err, result) {
|
|
32
|
-
|
|
33
|
-
if (err) {
|
|
34
|
-
return done(err);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// when
|
|
38
|
-
toXML(result, { format: true }, function(err, xml) {
|
|
39
|
-
validate(err, xml, done);
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
});
|