bpmnlint-plugin-camunda-compat 0.4.0 → 0.6.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/CHANGELOG.md CHANGED
@@ -6,11 +6,27 @@ All notable changes to [bpmnlint-plugin-camunda-compat](https://github.com/camun
6
6
 
7
7
  ___Note:__ Yet to be released changes appear here._
8
8
 
9
+ ## 0.6.1
10
+
11
+ * `FIX`: lanes supported ([#26](https://github.com/camunda/bpmnlint-plugin-camunda-compat/pull/26))
12
+
13
+ ## 0.6.0
14
+
15
+ * `FEAT`: adjust error messages to be more friendly ([#22](https://github.com/camunda/bpmnlint-plugin-camunda-compat/pull/22))
16
+ * `FEAT`: lint error code and message name ([#21](https://github.com/camunda/bpmnlint-plugin-camunda-compat/pull/21))
17
+ * `FIX`: task definition retries not required ([#20](https://github.com/camunda/bpmnlint-plugin-camunda-compat/pull/20))
18
+
19
+ ## 0.5.0
20
+
21
+ * `FEAT`: update Camunda Cloud rules to lint extension elements and their properties ([#18](https://github.com/camunda/bpmnlint-plugin-camunda-compat/pull/18))
22
+
9
23
  ## 0.4.0
24
+
10
25
  * `CHORE`: rename `Cloud` `1.4` to `8.0` ([#14](https://github.com/camunda/bpmnlint-plugin-camunda-compat/pull/14))
11
26
  * `CHORE`: rename `Cloud` to `Platform`/`Zeebe` ([#15](https://github.com/camunda/bpmnlint-plugin-camunda-compat/pull/15))
12
27
 
13
28
  ## 0.3.0
29
+
14
30
  * `FEAT`: support multiInstance for subprocesses with cloud 1.0 ([#6](https://github.com/camunda/bpmnlint-plugin-camunda-compat/pull/6))
15
31
  * `FEAT`: add Camunda Platform rules ([#5](https://github.com/camunda/bpmnlint-plugin-camunda-compat/pull/5))
16
32
  * `FEAT`: add Camunda Cloud 1.4 rule ([#5](https://github.com/camunda/bpmnlint-plugin-camunda-compat/pull/5))
package/index.js CHANGED
@@ -41,4 +41,4 @@ module.exports = {
41
41
  }
42
42
  }
43
43
  }
44
- }
44
+ };
package/package.json CHANGED
@@ -1,11 +1,13 @@
1
1
  {
2
2
  "name": "bpmnlint-plugin-camunda-compat",
3
- "version": "0.4.0",
3
+ "version": "0.6.1",
4
4
  "description": "A bpmnlint plug-in for Camunda Cloud and Platform compatibility",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
- "all": "npm test",
8
- "test": "mocha test/**/*.spec.js"
7
+ "all": "npm run lint && npm test",
8
+ "lint": "eslint .",
9
+ "test": "mocha test/**/*.spec.js",
10
+ "test:watch": "npm run test -- --watch"
9
11
  },
10
12
  "repository": {
11
13
  "type": "git",
@@ -22,13 +24,19 @@
22
24
  "license": "MIT",
23
25
  "devDependencies": {
24
26
  "bpmn-moddle": "^7.1.2",
25
- "bpmnlint": "^6.1.0",
27
+ "bpmnlint": "^7.6.0",
28
+ "camunda-bpmn-moddle": "^6.1.1",
26
29
  "chai": "^4.3.5",
30
+ "eslint": "^7.32.0",
31
+ "eslint-plugin-bpmn-io": "^0.13.0",
27
32
  "mocha": "^5.2.0",
28
33
  "modeler-moddle": "^0.1.0",
34
+ "sinon": "^13.0.1",
35
+ "sinon-chai": "^3.7.0",
29
36
  "zeebe-bpmn-moddle": "^0.10.0"
30
37
  },
31
38
  "dependencies": {
39
+ "@philippfromme/moddle-helpers": "^0.1.0",
32
40
  "bpmnlint-utils": "^1.0.2",
33
41
  "min-dash": "^3.8.0"
34
42
  },
@@ -1,19 +1,29 @@
1
1
  const {
2
- checkSome,
2
+ checkEventDefinition,
3
+ checkFlowNode,
4
+ checkIf,
5
+ hasErrorReference,
3
6
  hasEventDefinitionOfType,
4
- hasLoopCharacteristicsOfType,
5
- hasNoEventDefinition,
6
- hasNoLanes,
7
- hasNoLoopCharacteristics,
8
- isNotBpmn
9
- } = require('./utils/rule');
7
+ hasEventDefinitionOfTypeOrNone,
8
+ hasMessageReference,
9
+ isNotBpmn,
10
+ withTranslations
11
+ } = require('./utils/element');
12
+
13
+ const {
14
+ hasZeebeCalledElement,
15
+ hasZeebeLoopCharacteristics,
16
+ hasZeebeSubscription,
17
+ hasZeebeTaskDefinition
18
+ } = require('./utils/cloud/element');
19
+
20
+ const { checkEvery } = require('./utils/rule');
10
21
 
11
22
  module.exports = [
12
23
  {
13
24
  check: isNotBpmn
14
25
  },
15
26
  'bpmn:Association',
16
- 'bpmn:CallActivity',
17
27
  'bpmn:Collaboration',
18
28
  'bpmn:DataObject',
19
29
  'bpmn:DataObjectReference',
@@ -25,73 +35,202 @@ module.exports = [
25
35
  'bpmn:MessageFlow',
26
36
  'bpmn:ParallelGateway',
27
37
  'bpmn:Participant',
38
+ 'bpmn:Process',
28
39
  'bpmn:SequenceFlow',
29
40
  'bpmn:TextAnnotation',
30
41
  {
31
42
  type: 'bpmn:BoundaryEvent',
32
- check: hasEventDefinitionOfType([
33
- 'bpmn:ErrorEventDefinition',
34
- 'bpmn:MessageEventDefinition',
35
- 'bpmn:TimerEventDefinition'
36
- ])
43
+ check: withTranslations(
44
+ checkEvery(
45
+ hasEventDefinitionOfType([
46
+ 'bpmn:ErrorEventDefinition',
47
+ 'bpmn:MessageEventDefinition',
48
+ 'bpmn:TimerEventDefinition'
49
+ ]),
50
+ checkIf(
51
+ checkEventDefinition(hasErrorReference),
52
+ hasEventDefinitionOfType('bpmn:ErrorEventDefinition')
53
+ ),
54
+ checkIf(
55
+ checkEvery(
56
+ checkEventDefinition(hasMessageReference),
57
+ checkIf(
58
+ checkEventDefinition(hasZeebeSubscription),
59
+ checkEventDefinition(hasMessageReference)
60
+ )
61
+ ),
62
+ hasEventDefinitionOfType('bpmn:MessageEventDefinition')
63
+ )
64
+ ),
65
+ {
66
+ 'Element of type <bpmn:BoundaryEvent> not supported by {{ executionPlatform }}': 'An <Undefined Boundary Event> is not supported by {{ executionPlatform }}',
67
+ 'Element of type <bpmn:ErrorEventDefinition> must have property <errorRef>': 'An <Error Boundary Event> must have a defined <Error Reference>',
68
+ 'Element of type <bpmn:Error> must have property <errorCode>': 'An <Error Boundary Event> with <Error Reference> must have a defined <Error code>',
69
+ 'Element of type <bpmn:MessageEventDefinition> must have property <messageRef>': 'A <Message Boundary Event> must have a defined <Message Reference>',
70
+ 'Element of type <bpmn:Message> must have property <name>': 'A <Message Boundary Event> with <Message Reference> must have a defined <Name>',
71
+ 'Element of type <bpmn:Message> must have extension element of type <zeebe:Subscription>': 'A <Message Boundary Event> with <Message Reference> must have a defined <Subscription correlation key>',
72
+ 'Element of type <zeebe:Subscription> must have property <correlationKey>': 'A <Message Boundary Event> with <Message Reference> must have a defined <Subscription correlation key>'
73
+ }
74
+ )
37
75
  },
38
76
  {
39
- type: 'bpmn:EndEvent',
40
- check: checkSome(
41
- hasNoEventDefinition,
42
- hasEventDefinitionOfType([
43
- 'bpmn:ErrorEventDefinition'
44
- ])
77
+ type: 'bpmn:CallActivity',
78
+ check: withTranslations(
79
+ checkEvery(
80
+ hasZeebeCalledElement,
81
+ hasZeebeLoopCharacteristics
82
+ ),
83
+ {
84
+ 'Element of type <bpmn:CallActivity> must have extension element of type <zeebe:CalledElement>': 'A <Call Activity> must have a defined <Called element>',
85
+ 'Element of type <zeebe:CalledElement> must have property <processId>': 'A <Call Activity> must have a defined <Called element>',
86
+ 'Element of type <bpmn:MultiInstanceLoopCharacteristics> must have extension element of type <zeebe:LoopCharacteristics>': 'A <Call Activity> with <Multi-instance marker> must have a defined <Input collection>',
87
+ 'Element of type <zeebe:LoopCharacteristics> must have property <inputCollection>': 'A <Call Activity> with <Multi-instance marker> must have a defined <Input collection>',
88
+ 'Element of type <zeebe:LoopCharacteristics> must have property <outputElement> if it has property <outputCollection>': 'A <Call Activity> with <Multi-instance marker> and defined <Output collection> must have a defined <Output element>',
89
+ 'Element of type <zeebe:LoopCharacteristics> must have property <outputCollection> if it has property <outputElement>': 'A <Call Activity> with <Multi-instance marker> and defined <Output element> must have a defined <Output collection>'
90
+ }
45
91
  )
46
92
  },
47
93
  {
48
- type: 'bpmn:IntermediateCatchEvent',
49
- check: hasEventDefinitionOfType([
50
- 'bpmn:MessageEventDefinition',
51
- 'bpmn:TimerEventDefinition'
52
- ])
94
+ type: 'bpmn:EndEvent',
95
+ check: withTranslations(
96
+ checkEvery(
97
+ hasEventDefinitionOfTypeOrNone('bpmn:ErrorEventDefinition'),
98
+ checkIf(
99
+ checkEventDefinition(hasErrorReference),
100
+ hasEventDefinitionOfType('bpmn:ErrorEventDefinition')
101
+ )
102
+ ),
103
+ {
104
+ 'Element of type <bpmn:EndEvent> (<bpmn:MessageEventDefinition>) not supported by {{ executionPlatform }}': 'A <Message End Event> is not supported by {{ executionPlatform }}',
105
+ 'Element of type <bpmn:ErrorEventDefinition> must have property <errorRef>': 'An <Error End Event> must have a defined <Error Reference>',
106
+ 'Element of type <bpmn:Error> must have property <errorCode>': 'An <Error End Event> with <Error Reference> must have a defined <Error code>'
107
+ }
108
+ )
53
109
  },
54
110
  {
55
- type: 'bpmn:Process',
56
- check: hasNoLanes
111
+ type: 'bpmn:IntermediateCatchEvent',
112
+ check: withTranslations(
113
+ checkEvery(
114
+ hasEventDefinitionOfType([
115
+ 'bpmn:TimerEventDefinition',
116
+ 'bpmn:MessageEventDefinition'
117
+ ]),
118
+ checkIf(
119
+ checkEvery(
120
+ checkEventDefinition(hasMessageReference),
121
+ checkIf(
122
+ checkEventDefinition(hasZeebeSubscription),
123
+ checkEventDefinition(hasMessageReference)
124
+ )
125
+ ),
126
+ hasEventDefinitionOfType('bpmn:MessageEventDefinition')
127
+ )
128
+ ),
129
+ {
130
+ 'Element of type <bpmn:IntermediateCatchEvent> not supported by {{ executionPlatform }}': 'A <Undefined Intermediate Catch Event> is not supported by {{ executionPlatform }}',
131
+ 'Element of type <bpmn:MessageEventDefinition> must have property <messageRef>': 'A <Message Intermediate Catch Event> must have a defined <Message Reference>',
132
+ 'Element of type <bpmn:Message> must have property <name>': 'A <Message Intermediate Catch Event> with <Message Reference> must have a defined <Name>',
133
+ 'Element of type <bpmn:Message> must have extension element of type <zeebe:Subscription>': 'A <Message Intermediate Catch Event> with <Message Reference> must have a defined <Subscription correlation key>',
134
+ 'Element of type <zeebe:Subscription> must have property <correlationKey>': 'A <Message Intermediate Catch Event> with <Message Reference> must have a defined <Subscription correlation key>'
135
+ }
136
+ )
57
137
  },
58
138
  {
59
139
  type: 'bpmn:ReceiveTask',
60
- check: checkSome(
61
- hasNoLoopCharacteristics,
62
- hasLoopCharacteristicsOfType('bpmn:MultiInstanceLoopCharacteristics')
140
+ check: withTranslations(
141
+ checkEvery(
142
+ checkFlowNode(hasMessageReference),
143
+ checkIf(
144
+ checkFlowNode(hasZeebeSubscription),
145
+ checkFlowNode(hasMessageReference)
146
+ ),
147
+ hasZeebeLoopCharacteristics
148
+ ),
149
+ {
150
+ 'Element of type <bpmn:MultiInstanceLoopCharacteristics> must have extension element of type <zeebe:LoopCharacteristics>': 'A <Receive Task> with <Multi-instance marker> must have a defined <Input collection>',
151
+ 'Element of type <zeebe:LoopCharacteristics> must have property <inputCollection>': 'A <Receive Task> with <Multi-instance marker> must have a defined <Input collection>',
152
+ 'Element of type <zeebe:LoopCharacteristics> must have property <outputElement> if it has property <outputCollection>': 'A <Receive Task> with <Multi-instance marker> and defined <Output collection> must have a defined <Output element>',
153
+ 'Element of type <zeebe:LoopCharacteristics> must have property <outputCollection> if it has property <outputElement>': 'A <Receive Task> with <Multi-instance marker> and defined <Output element> must have a defined <Output collection>',
154
+ 'Element of type <bpmn:ReceiveTask> must have property <messageRef>': 'A <Receive Task> must have a defined <Message Reference>',
155
+ 'Element of type <bpmn:Message> must have property <name>': 'A <Receive Task> with <Message Reference> must have a defined <Name>',
156
+ 'Element of type <bpmn:Message> must have extension element of type <zeebe:Subscription>': 'A <Receive Task> with <Message Reference> must have a defined <Subscription correlation key>',
157
+ 'Element of type <zeebe:Subscription> must have property <correlationKey>': 'A <Receive Task> with <Message Reference> must have a defined <Subscription correlation key>'
158
+ }
63
159
  )
64
160
  },
65
161
  {
66
162
  type: 'bpmn:ServiceTask',
67
- check: checkSome(
68
- hasNoLoopCharacteristics,
69
- hasLoopCharacteristicsOfType('bpmn:MultiInstanceLoopCharacteristics')
163
+ check: withTranslations(
164
+ checkEvery(
165
+ hasZeebeLoopCharacteristics,
166
+ hasZeebeTaskDefinition
167
+ ),
168
+ {
169
+ 'Element of type <bpmn:ServiceTask> must have extension element of type <zeebe:TaskDefinition>': 'A <Service Task> must have a <Task definition type>',
170
+ 'Element of type <zeebe:TaskDefinition> must have property <type>': 'A <Service Task> must have a <Task definition type>',
171
+ 'Element of type <bpmn:MultiInstanceLoopCharacteristics> must have extension element of type <zeebe:LoopCharacteristics>': 'A <Service Task> with <Multi-instance marker> must have a defined <Input collection>',
172
+ 'Element of type <zeebe:LoopCharacteristics> must have property <inputCollection>': 'A <Service Task> with <Multi-instance marker> must have a defined <Input collection>',
173
+ 'Element of type <zeebe:LoopCharacteristics> must have property <outputElement> if it has property <outputCollection>': 'A <Service Task> with <Multi-instance marker> and defined <Output collection> must have a defined <Output element>',
174
+ 'Element of type <zeebe:LoopCharacteristics> must have property <outputCollection> if it has property <outputElement>': 'A <Service Task> with <Multi-instance marker> and defined <Output element> must have a defined <Output collection>'
175
+ }
70
176
  )
71
177
  },
72
178
  {
73
179
  type: 'bpmn:StartEvent',
74
- check: checkSome(
75
- hasNoEventDefinition,
76
- hasEventDefinitionOfType([
77
- 'bpmn:ErrorEventDefinition',
78
- 'bpmn:MessageEventDefinition',
79
- 'bpmn:TimerEventDefinition'
80
- ])
180
+ check: withTranslations(
181
+ checkEvery(
182
+ hasEventDefinitionOfTypeOrNone([
183
+ 'bpmn:ErrorEventDefinition',
184
+ 'bpmn:MessageEventDefinition',
185
+ 'bpmn:TimerEventDefinition'
186
+ ]),
187
+ checkIf(
188
+ checkEventDefinition(hasErrorReference),
189
+ hasEventDefinitionOfType('bpmn:ErrorEventDefinition')
190
+ ),
191
+ checkIf(
192
+ checkEvery(
193
+ checkEventDefinition(hasMessageReference),
194
+ checkIf(
195
+ checkEventDefinition(hasZeebeSubscription),
196
+ checkEventDefinition(hasMessageReference)
197
+ )
198
+ ),
199
+ hasEventDefinitionOfType('bpmn:MessageEventDefinition')
200
+ )
201
+ ),
202
+ {
203
+ 'Element of type <bpmn:ErrorEventDefinition> must have property <errorRef>': 'An <Error Start Event> must have a defined <Error Reference>',
204
+ 'Element of type <bpmn:Error> must have property <errorCode>': 'An <Error Start Event> with <Error Reference> must have a defined <Error code>',
205
+ 'Element of type <bpmn:MessageEventDefinition> must have property <messageRef>': 'A <Message Start Event> must have a defined <Message Reference>',
206
+ 'Element of type <bpmn:Message> must have property <name>': 'A <Message Start Event> with <Message Reference> must have a defined <Name>',
207
+ 'Element of type <bpmn:Message> must have extension element of type <zeebe:Subscription>': 'A <Message Start Event> with <Message Reference> must have a defined <Subscription correlation key>',
208
+ 'Element of type <zeebe:Subscription> must have property <correlationKey>': 'A <Message Start Event> with <Message Reference> must have a defined <Subscription correlation key>'
209
+ }
81
210
  )
82
211
  },
83
212
  {
84
213
  type: 'bpmn:SubProcess',
85
- check: checkSome(
86
- hasNoLoopCharacteristics,
87
- hasLoopCharacteristicsOfType('bpmn:MultiInstanceLoopCharacteristics')
214
+ check: withTranslations(
215
+ hasZeebeLoopCharacteristics,
216
+ {
217
+ 'Element of type <bpmn:MultiInstanceLoopCharacteristics> must have extension element of type <zeebe:LoopCharacteristics>': 'A <Sub Process> with <Multi-instance marker> must have a defined <Input collection>',
218
+ 'Element of type <zeebe:LoopCharacteristics> must have property <inputCollection>': 'A <Sub Process> with <Multi-instance marker> must have a defined <Input collection>',
219
+ 'Element of type <zeebe:LoopCharacteristics> must have property <outputElement> if it has property <outputCollection>': 'A <Sub Process> with <Multi-instance marker> and defined <Output collection> must have a defined <Output element>',
220
+ 'Element of type <zeebe:LoopCharacteristics> must have property <outputCollection> if it has property <outputElement>': 'A <Sub Process> with <Multi-instance marker> and defined <Output element> must have a defined <Output collection>'
221
+ }
88
222
  )
89
223
  },
90
224
  {
91
225
  type: 'bpmn:UserTask',
92
- check: checkSome(
93
- hasNoLoopCharacteristics,
94
- hasLoopCharacteristicsOfType('bpmn:MultiInstanceLoopCharacteristics')
226
+ check: withTranslations(
227
+ hasZeebeLoopCharacteristics,
228
+ {
229
+ 'Element of type <bpmn:MultiInstanceLoopCharacteristics> must have extension element of type <zeebe:LoopCharacteristics>': 'A <User Task> with <Multi-instance marker> must have a defined <Input collection>',
230
+ 'Element of type <zeebe:LoopCharacteristics> must have property <inputCollection>': 'A <User Task> with <Multi-instance marker> must have a defined <Input collection>',
231
+ 'Element of type <zeebe:LoopCharacteristics> must have property <outputElement> if it has property <outputCollection>': 'A <User Task> with <Multi-instance marker> and defined <Output collection> must have a defined <Output element>',
232
+ 'Element of type <zeebe:LoopCharacteristics> must have property <outputCollection> if it has property <outputElement>': 'A <User Task> with <Multi-instance marker> and defined <Output element> must have a defined <Output collection>'
233
+ }
95
234
  )
96
235
  }
97
236
  ];
@@ -2,4 +2,4 @@ const { createRule } = require('./utils/rule');
2
2
 
3
3
  const checks = require('./camunda-cloud-1-0-checks');
4
4
 
5
- module.exports = createRule('Camunda Cloud', '1.0', checks, 'Zeebe');
5
+ module.exports = createRule('Camunda Cloud', '1.0', checks, 'Camunda Platform 8 (Zeebe 1.0)');
@@ -1,44 +1,89 @@
1
1
  const camundaCloud10Checks = require('./camunda-cloud-1-0-checks');
2
2
 
3
+ const { checkEvery } = require('./utils/rule');
4
+
3
5
  const {
4
- checkSome,
5
- hasLoopCharacteristicsOfType,
6
6
  hasNoEventDefinition,
7
- hasNoLoopCharacteristics
8
- } = require('./utils/rule');
7
+ withTranslations
8
+ } = require('./utils/element');
9
+
10
+ const {
11
+ hasZeebeTaskDefinition,
12
+ hasZeebeLoopCharacteristics
13
+ } = require('./utils/cloud/element');
9
14
 
10
15
  module.exports = [
11
16
  ...camundaCloud10Checks,
12
17
  {
13
18
  type: 'bpmn:BusinessRuleTask',
14
- check: checkSome(
15
- hasNoLoopCharacteristics,
16
- hasLoopCharacteristicsOfType('bpmn:MultiInstanceLoopCharacteristics')
19
+ check: withTranslations(
20
+ checkEvery(
21
+ hasZeebeLoopCharacteristics,
22
+ hasZeebeTaskDefinition
23
+ ),
24
+ {
25
+ 'Element of type <bpmn:BusinessRuleTask> must have extension element of type <zeebe:TaskDefinition>': 'A <Business Rule Task> must have a <Task definition type>',
26
+ 'Element of type <zeebe:TaskDefinition> must have property <type>': 'A <Business Rule Task> must have a <Task definition type>',
27
+ 'Element of type <bpmn:MultiInstanceLoopCharacteristics> must have extension element of type <zeebe:LoopCharacteristics>': 'A <Business Rule Task> with <Multi-instance marker> must have a defined <Input collection>',
28
+ 'Element of type <zeebe:LoopCharacteristics> must have property <inputCollection>': 'A <Business Rule Task> with <Multi-instance marker> must have a defined <Input collection>',
29
+ 'Element of type <zeebe:LoopCharacteristics> must have property <outputElement> if it has property <outputCollection>': 'A <Business Rule Task> with <Multi-instance marker> and defined <Output collection> must have a defined <Output element>',
30
+ 'Element of type <zeebe:LoopCharacteristics> must have property <outputCollection> if it has property <outputElement>': 'A <Business Rule Task> with <Multi-instance marker> and defined <Output element> must have a defined <Output collection>'
31
+ }
17
32
  )
18
33
  },
19
34
  {
20
35
  type: 'bpmn:IntermediateThrowEvent',
21
- check: hasNoEventDefinition
36
+ check: withTranslations(
37
+ hasNoEventDefinition,
38
+ {
39
+ 'Element of type <bpmn:IntermediateThrowEvent> (<bpmn:MessageEventDefinition>) not supported by {{ executionPlatform }}': 'A <Message Intermediate Throw Event> is not supported by {{ executionPlatform }}'
40
+ }
41
+ )
22
42
  },
23
43
  {
24
44
  type: 'bpmn:ManualTask',
25
- check: checkSome(
26
- hasNoLoopCharacteristics,
27
- hasLoopCharacteristicsOfType('bpmn:MultiInstanceLoopCharacteristics')
45
+ check: withTranslations(
46
+ hasZeebeLoopCharacteristics,
47
+ {
48
+ 'Element of type <bpmn:MultiInstanceLoopCharacteristics> must have extension element of type <zeebe:LoopCharacteristics>': 'A <Manual Task> with <Multi-instance marker> must have a defined <Input collection>',
49
+ 'Element of type <zeebe:LoopCharacteristics> must have property <inputCollection>': 'A <Manual Task> with <Multi-instance marker> must have a defined <Input collection>',
50
+ 'Element of type <zeebe:LoopCharacteristics> must have property <outputElement> if it has property <outputCollection>': 'A <Manual Task> with <Multi-instance marker> and defined <Output collection> must have a defined <Output element>',
51
+ 'Element of type <zeebe:LoopCharacteristics> must have property <outputCollection> if it has property <outputElement>': 'A <Manual Task> with <Multi-instance marker> and defined <Output element> must have a defined <Output collection>'
52
+ }
28
53
  )
29
54
  },
30
55
  {
31
56
  type: 'bpmn:ScriptTask',
32
- check: checkSome(
33
- hasNoLoopCharacteristics,
34
- hasLoopCharacteristicsOfType('bpmn:MultiInstanceLoopCharacteristics')
57
+ check: withTranslations(
58
+ checkEvery(
59
+ hasZeebeLoopCharacteristics,
60
+ hasZeebeTaskDefinition
61
+ ),
62
+ {
63
+ 'Element of type <bpmn:ScriptTask> must have extension element of type <zeebe:TaskDefinition>': 'A <Script Task> must have a <Task definition type>',
64
+ 'Element of type <zeebe:TaskDefinition> must have property <type>': 'A <Script Task> must have a <Task definition type>',
65
+ 'Element of type <bpmn:MultiInstanceLoopCharacteristics> must have extension element of type <zeebe:LoopCharacteristics>': 'A <Script Task> with <Multi-instance marker> must have a defined <Input collection>',
66
+ 'Element of type <zeebe:LoopCharacteristics> must have property <inputCollection>': 'A <Script Task> with <Multi-instance marker> must have a defined <Input collection>',
67
+ 'Element of type <zeebe:LoopCharacteristics> must have property <outputElement> if it has property <outputCollection>': 'A <Script Task> with <Multi-instance marker> and defined <Output collection> must have a defined <Output element>',
68
+ 'Element of type <zeebe:LoopCharacteristics> must have property <outputCollection> if it has property <outputElement>': 'A <Script Task> with <Multi-instance marker> and defined <Output element> must have a defined <Output collection>'
69
+ }
35
70
  )
36
71
  },
37
72
  {
38
73
  type: 'bpmn:SendTask',
39
- check: checkSome(
40
- hasNoLoopCharacteristics,
41
- hasLoopCharacteristicsOfType('bpmn:MultiInstanceLoopCharacteristics')
74
+ check: withTranslations(
75
+ checkEvery(
76
+ hasZeebeLoopCharacteristics,
77
+ hasZeebeTaskDefinition
78
+ ),
79
+ {
80
+ 'Element of type <bpmn:SendTask> must have extension element of type <zeebe:TaskDefinition>': 'A <Send Task> must have a <Task definition type>',
81
+ 'Element of type <zeebe:TaskDefinition> must have property <type>': 'A <Send Task> must have a <Task definition type>',
82
+ 'Element of type <bpmn:MultiInstanceLoopCharacteristics> must have extension element of type <zeebe:LoopCharacteristics>': 'A <Send Task> with <Multi-instance marker> must have a defined <Input collection>',
83
+ 'Element of type <zeebe:LoopCharacteristics> must have property <inputCollection>': 'A <Send Task> with <Multi-instance marker> must have a defined <Input collection>',
84
+ 'Element of type <zeebe:LoopCharacteristics> must have property <outputElement> if it has property <outputCollection>': 'A <Send Task> with <Multi-instance marker> and defined <Output collection> must have a defined <Output element>',
85
+ 'Element of type <zeebe:LoopCharacteristics> must have property <outputCollection> if it has property <outputElement>': 'A <Send Task> with <Multi-instance marker> and defined <Output element> must have a defined <Output collection>'
86
+ }
42
87
  )
43
88
  }
44
89
  ];
@@ -2,4 +2,4 @@ const { createRule } = require('./utils/rule');
2
2
 
3
3
  const checks = require('./camunda-cloud-1-1-checks');
4
4
 
5
- module.exports = createRule('Camunda Cloud', '1.1', checks, 'Zeebe');
5
+ module.exports = createRule('Camunda Cloud', '1.1', checks, 'Camunda Platform 8 (Zeebe 1.1)');
@@ -1,19 +1,60 @@
1
1
  const camundaCloud11Checks = require('./camunda-cloud-1-1-checks');
2
2
 
3
- const { hasEventDefinitionOfType } = require('./utils/rule');
4
-
3
+ const {
4
+ checkEvery,
5
+ replaceChecks
6
+ } = require('./utils/rule');
7
+
8
+ const {
9
+ checkEventDefinition,
10
+ checkIf,
11
+ hasErrorReference,
12
+ hasEventDefinitionOfType,
13
+ hasEventDefinitionOfTypeOrNone,
14
+ withTranslations
15
+ } = require('./utils/element');
16
+
17
+ const { hasZeebeTaskDefinition } = require('./utils/cloud/element');
18
+
5
19
  module.exports = [
6
- ...camundaCloud11Checks,
7
- {
8
- type: 'bpmn:EndEvent',
9
- check: hasEventDefinitionOfType([
10
- 'bpmn:MessageEventDefinition'
11
- ])
12
- },
13
- {
14
- type: 'bpmn:IntermediateThrowEvent',
15
- check: hasEventDefinitionOfType([
16
- 'bpmn:MessageEventDefinition'
17
- ])
18
- }
20
+ ...replaceChecks(
21
+ camundaCloud11Checks,
22
+ [
23
+ {
24
+ type: 'bpmn:IntermediateThrowEvent',
25
+ check: withTranslations(
26
+ checkEvery(
27
+ hasEventDefinitionOfTypeOrNone('bpmn:MessageEventDefinition'),
28
+ checkIf(
29
+ hasZeebeTaskDefinition,
30
+ hasEventDefinitionOfType('bpmn:MessageEventDefinition')
31
+ )
32
+ ),
33
+ {
34
+ 'Element of type <bpmn:IntermediateThrowEvent> must have extension element of type <zeebe:TaskDefinition>': 'An <Intermediate Throw Event> must have a <Task definition type>',
35
+ 'Element of type <zeebe:TaskDefinition> must have property <type>': 'An <Intermediate Throw Event> must have a <Task definition type>'
36
+ }
37
+ )
38
+ },
39
+ {
40
+ type: 'bpmn:EndEvent',
41
+ check: withTranslations(
42
+ checkEvery(
43
+ hasEventDefinitionOfTypeOrNone([
44
+ 'bpmn:ErrorEventDefinition',
45
+ 'bpmn:MessageEventDefinition'
46
+ ]),
47
+ checkIf(
48
+ checkEventDefinition(hasErrorReference),
49
+ hasEventDefinitionOfType('bpmn:ErrorEventDefinition')
50
+ )
51
+ ),
52
+ {
53
+ 'Element of type <bpmn:ErrorEventDefinition> must have property <errorRef>': 'An <Error End Event> must have a defined <Error Reference>',
54
+ 'Element of type <bpmn:Error> must have property <errorCode>': 'An <Error End Event> with <Error Reference> must have a defined <Error code>'
55
+ }
56
+ )
57
+ }
58
+ ]
59
+ )
19
60
  ];
@@ -2,4 +2,4 @@ const { createRule } = require('./utils/rule');
2
2
 
3
3
  const checks = require('./camunda-cloud-1-2-checks');
4
4
 
5
- module.exports = createRule('Camunda Cloud', '1.2', checks, 'Zeebe');
5
+ module.exports = createRule('Camunda Cloud', '1.2', checks, 'Camunda Platform 8 (Zeebe 1.2)');
@@ -1,5 +1,37 @@
1
1
  const camundaCloud12Checks = require('./camunda-cloud-1-2-checks');
2
2
 
3
+ const {
4
+ checkEvery,
5
+ replaceCheck
6
+ } = require('./utils/rule');
7
+
8
+ const { withTranslations } = require('./utils/element');
9
+
10
+ const {
11
+ hasZeebeCalledDecisionOrTaskDefinition,
12
+ hasZeebeLoopCharacteristics
13
+ } = require('./utils/cloud/element');
14
+
3
15
  module.exports = [
4
- ...camundaCloud12Checks
16
+ ...replaceCheck(
17
+ camundaCloud12Checks,
18
+ 'bpmn:BusinessRuleTask',
19
+ withTranslations(
20
+ checkEvery(
21
+ hasZeebeCalledDecisionOrTaskDefinition,
22
+ hasZeebeLoopCharacteristics
23
+ ),
24
+ {
25
+ 'Element of type <bpmn:BusinessRuleTask> must have one extension element of type <zeebe:CalledDecision> or <zeebe:TaskDefinition>': 'A <Business Rule Task> must have a defined <Implementation>',
26
+ 'Element of type <bpmn:BusinessRuleTask> must have one or many extension elements of type <zeebe:CalledDecision> or <zeebe:TaskDefinition>': 'A <Business Rule Task> must have a defined <Implementation>',
27
+ 'Element of type <zeebe:TaskDefinition> must have property <type>': 'A <Business Rule Task> with <Implementation: Job worker> must have a defined <Task definition type>',
28
+ 'Element of type <zeebe:CalledDecision> must have property <decisionId>': 'A <Business Rule Task> with <Implementation: DMN decision> must have a defined <Called decision ID>',
29
+ 'Element of type <zeebe:CalledDecision> must have property <resultVariable>': 'A Business Rule Task with <Implementation: DMN decision> must have a defined <Result variable>',
30
+ 'Element of type <bpmn:MultiInstanceLoopCharacteristics> must have extension element of type <zeebe:LoopCharacteristics>': 'A <Business Rule Task> with <Multi-instance marker> must have a defined <Input collection>',
31
+ 'Element of type <zeebe:LoopCharacteristics> must have property <inputCollection>': 'A <Business Rule Task> with <Multi-instance marker> must have a defined <Input collection>',
32
+ 'Element of type <zeebe:LoopCharacteristics> must have property <outputElement> if it has property <outputCollection>': 'A <Business Rule Task> with <Multi-instance marker> and defined <Output collection> must have a defined <Output element>',
33
+ 'Element of type <zeebe:LoopCharacteristics> must have property <outputCollection> if it has property <outputElement>': 'A <Business Rule Task> with <Multi-instance marker> and defined <Output element> must have a defined <Output collection>'
34
+ }
35
+ )
36
+ )
5
37
  ];
@@ -2,4 +2,4 @@ const { createRule } = require('./utils/rule');
2
2
 
3
3
  const checks = require('./camunda-cloud-1-3-checks');
4
4
 
5
- module.exports = createRule('Camunda Cloud', '1.3', checks, 'Zeebe');
5
+ module.exports = createRule('Camunda Cloud', '1.3', checks, 'Camunda Platform 8 (Zeebe 1.3)');
@@ -2,4 +2,4 @@ const { createRule } = require('./utils/rule');
2
2
 
3
3
  const checks = require('./camunda-cloud-8-0-checks');
4
4
 
5
- module.exports = createRule('Camunda Cloud', '8.0', checks, 'Camunda Platform');
5
+ module.exports = createRule('Camunda Cloud', '8.0', checks, 'Camunda Platform 8');