@camunda/linting 0.10.0 → 0.12.0
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ERROR_TYPES } from 'bpmnlint-plugin-camunda-compat/rules/utils/element';
|
|
2
2
|
|
|
3
|
-
import { is } from 'bpmnlint-utils';
|
|
3
|
+
import { is, isAny } from 'bpmnlint-utils';
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
every,
|
|
@@ -216,6 +216,10 @@ function getExtensionElementNotAllowedErrorMessage(report, executionPlatform, ex
|
|
|
216
216
|
return getSupportedMessage(`${ getIndefiniteArticle(typeString) } <${ typeString }> with <Extension properties>`, executionPlatform, executionPlatformVersion, allowedVersion);
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
+
if (is(node, 'bpmn:ScriptTask') && is(extensionElement, 'zeebe:Script')) {
|
|
220
|
+
return getSupportedMessage('A <Script Task> with <Implementation: FEEL expression>', executionPlatform, executionPlatformVersion, allowedVersion);
|
|
221
|
+
}
|
|
222
|
+
|
|
219
223
|
return message;
|
|
220
224
|
}
|
|
221
225
|
|
|
@@ -253,6 +257,10 @@ function getExtensionElementRequiredErrorMessage(report) {
|
|
|
253
257
|
return `${ getIndefiniteArticle(typeString) } <${ typeString }> must have a defined <Implementation>`;
|
|
254
258
|
}
|
|
255
259
|
|
|
260
|
+
if (isArray(requiredExtensionElement) && requiredExtensionElement.includes('zeebe:Script')) {
|
|
261
|
+
return `${ getIndefiniteArticle(typeString) } <${ typeString }> must have a defined <Implementation>`;
|
|
262
|
+
}
|
|
263
|
+
|
|
256
264
|
return message;
|
|
257
265
|
}
|
|
258
266
|
|
|
@@ -335,8 +343,16 @@ function getPropertyRequiredErrorMessage(report) {
|
|
|
335
343
|
return 'A <Business Rule Task> with <Implementation: DMN decision> must have a defined <Result variable>';
|
|
336
344
|
}
|
|
337
345
|
|
|
338
|
-
if (parentNode && is(parentNode, 'bpmn:
|
|
339
|
-
return 'A <
|
|
346
|
+
if (parentNode && is(parentNode, 'bpmn:ScriptTask') && is(node, 'zeebe:Script') && requiredProperty === 'expression') {
|
|
347
|
+
return 'A <Script Task> with <Implementation: FEEL expression> must have a defined <FEEL expression>';
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
if (parentNode && is(parentNode, 'bpmn:ScriptTask') && is(node, 'zeebe:Script') && requiredProperty === 'resultVariable') {
|
|
351
|
+
return 'A <Script Task> with <Implementation: FEEL expression> must have a defined <Result variable>';
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
if (parentNode && isAny(parentNode, [ 'bpmn:BusinessRuleTask', 'bpmn:ScriptTask' ]) && is(node, 'zeebe:TaskDefinition') && requiredProperty === 'type') {
|
|
355
|
+
return `${ getIndefiniteArticle(typeString) } <${ typeString }> with <Implementation: Job worker> must have a defined <Task definition type>`;
|
|
340
356
|
}
|
|
341
357
|
|
|
342
358
|
if (is(node, 'zeebe:CalledElement') && requiredProperty === 'processId') {
|
|
@@ -59,6 +59,11 @@ export function getEntryIds(report) {
|
|
|
59
59
|
return [ 'businessRuleImplementation' ];
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
// script task
|
|
63
|
+
if (isExtensionElementRequiredError(data, 'zeebe:Script', 'bpmn:ScriptTask')) {
|
|
64
|
+
return [ 'scriptImplementation' ];
|
|
65
|
+
}
|
|
66
|
+
|
|
62
67
|
if (isPropertyError(data, 'errorRef')) {
|
|
63
68
|
return [ 'errorRef' ];
|
|
64
69
|
}
|
|
@@ -71,10 +76,14 @@ export function getEntryIds(report) {
|
|
|
71
76
|
return [ 'decisionId' ];
|
|
72
77
|
}
|
|
73
78
|
|
|
74
|
-
if (isPropertyError(data, 'resultVariable'
|
|
79
|
+
if (isPropertyError(data, 'resultVariable')) {
|
|
75
80
|
return [ 'resultVariable' ];
|
|
76
81
|
}
|
|
77
82
|
|
|
83
|
+
if (isPropertyError(data, 'expression', 'zeebe:Script')) {
|
|
84
|
+
return [ 'scriptExpression' ];
|
|
85
|
+
}
|
|
86
|
+
|
|
78
87
|
if (isPropertyError(data, 'errorCode', 'bpmn:Error')) {
|
|
79
88
|
return [ 'errorCode' ];
|
|
80
89
|
}
|
|
@@ -217,7 +226,7 @@ export function getErrorMessage(id, report) {
|
|
|
217
226
|
}
|
|
218
227
|
}
|
|
219
228
|
|
|
220
|
-
if (
|
|
229
|
+
if ([ 'businessRuleImplementation', 'scriptImplementation' ].includes(id)) {
|
|
221
230
|
return 'Implementation must be defined.';
|
|
222
231
|
}
|
|
223
232
|
|
|
@@ -233,6 +242,10 @@ export function getErrorMessage(id, report) {
|
|
|
233
242
|
return 'Decision ID must be defined.';
|
|
234
243
|
}
|
|
235
244
|
|
|
245
|
+
if (id === 'scriptExpression') {
|
|
246
|
+
return 'FEEL expression must be defined.';
|
|
247
|
+
}
|
|
248
|
+
|
|
236
249
|
if (id === 'resultVariable') {
|
|
237
250
|
return 'Result variable must be defined.';
|
|
238
251
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camunda/linting",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Linting for Camunda Platform",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -27,16 +27,15 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"bpmn-moddle": "^7.1.3",
|
|
29
29
|
"bpmnlint": "^8.0.0",
|
|
30
|
-
"bpmnlint-plugin-camunda-compat": "^0.
|
|
30
|
+
"bpmnlint-plugin-camunda-compat": "^0.17.0",
|
|
31
31
|
"bpmnlint-utils": "^1.0.2",
|
|
32
32
|
"min-dash": "^4.0.0",
|
|
33
33
|
"min-dom": "^4.0.1",
|
|
34
|
-
"zeebe-bpmn-moddle": "^0.
|
|
34
|
+
"zeebe-bpmn-moddle": "^0.17.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@bpmn-io/properties-panel": "^0.23.0",
|
|
38
37
|
"bpmn-js": "^9.4.0",
|
|
39
|
-
"bpmn-js-properties-panel": "^1.
|
|
38
|
+
"bpmn-js-properties-panel": "^1.13.0",
|
|
40
39
|
"chai": "^4.3.6",
|
|
41
40
|
"cross-env": "^7.0.3",
|
|
42
41
|
"eslint": "^8.23.1",
|