@camunda/linting 3.16.0 → 3.17.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.
@@ -54,6 +54,7 @@ const rules = {
54
54
  "camunda-compat/no-task-schedule": "error",
55
55
  "camunda-compat/no-template": "error",
56
56
  "camunda-compat/no-zeebe-properties": "error",
57
+ "camunda-compat/no-zeebe-user-task": "error",
57
58
  "camunda-compat/secrets": "warn",
58
59
  "camunda-compat/sequence-flow-condition": "error",
59
60
  "camunda-compat/signal-reference": "error",
@@ -178,38 +179,42 @@ import rule_24 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-zeebe
178
179
 
179
180
  cache['bpmnlint-plugin-camunda-compat/no-zeebe-properties'] = rule_24;
180
181
 
181
- import rule_25 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/secrets';
182
+ import rule_25 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-zeebe-user-task';
182
183
 
183
- cache['bpmnlint-plugin-camunda-compat/secrets'] = rule_25;
184
+ cache['bpmnlint-plugin-camunda-compat/no-zeebe-user-task'] = rule_25;
184
185
 
185
- import rule_26 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/sequence-flow-condition';
186
+ import rule_26 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/secrets';
186
187
 
187
- cache['bpmnlint-plugin-camunda-compat/sequence-flow-condition'] = rule_26;
188
+ cache['bpmnlint-plugin-camunda-compat/secrets'] = rule_26;
188
189
 
189
- import rule_27 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/signal-reference';
190
+ import rule_27 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/sequence-flow-condition';
190
191
 
191
- cache['bpmnlint-plugin-camunda-compat/signal-reference'] = rule_27;
192
+ cache['bpmnlint-plugin-camunda-compat/sequence-flow-condition'] = rule_27;
192
193
 
193
- import rule_28 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/start-event-form';
194
+ import rule_28 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/signal-reference';
194
195
 
195
- cache['bpmnlint-plugin-camunda-compat/start-event-form'] = rule_28;
196
+ cache['bpmnlint-plugin-camunda-compat/signal-reference'] = rule_28;
196
197
 
197
- import rule_29 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/subscription';
198
+ import rule_29 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/start-event-form';
198
199
 
199
- cache['bpmnlint-plugin-camunda-compat/subscription'] = rule_29;
200
+ cache['bpmnlint-plugin-camunda-compat/start-event-form'] = rule_29;
200
201
 
201
- import rule_30 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/task-schedule';
202
+ import rule_30 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/subscription';
202
203
 
203
- cache['bpmnlint-plugin-camunda-compat/task-schedule'] = rule_30;
204
+ cache['bpmnlint-plugin-camunda-compat/subscription'] = rule_30;
204
205
 
205
- import rule_31 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/timer';
206
+ import rule_31 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/task-schedule';
206
207
 
207
- cache['bpmnlint-plugin-camunda-compat/timer'] = rule_31;
208
+ cache['bpmnlint-plugin-camunda-compat/task-schedule'] = rule_31;
208
209
 
209
- import rule_32 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/user-task-definition';
210
+ import rule_32 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/timer';
210
211
 
211
- cache['bpmnlint-plugin-camunda-compat/user-task-definition'] = rule_32;
212
+ cache['bpmnlint-plugin-camunda-compat/timer'] = rule_32;
212
213
 
213
- import rule_33 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/user-task-form';
214
+ import rule_33 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/user-task-definition';
214
215
 
215
- cache['bpmnlint-plugin-camunda-compat/user-task-form'] = rule_33;
216
+ cache['bpmnlint-plugin-camunda-compat/user-task-definition'] = rule_33;
217
+
218
+ import rule_34 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/user-task-form';
219
+
220
+ cache['bpmnlint-plugin-camunda-compat/user-task-form'] = rule_34;
@@ -274,6 +274,10 @@ function getExtensionElementNotAllowedErrorMessage(report, executionPlatform, ex
274
274
  return getSupportedMessage(`${ getIndefiniteArticle(typeString) } <${ typeString }> with <Extension properties>`, executionPlatform, executionPlatformVersion, allowedVersion);
275
275
  }
276
276
 
277
+ if (is(extensionElement, 'zeebe:UserTask')) {
278
+ return getSupportedMessage('A <User Task> with <Implementation: Zeebe user task>', executionPlatform, executionPlatformVersion, allowedVersion);
279
+ }
280
+
277
281
  if (is(node, 'bpmn:ScriptTask') && is(extensionElement, 'zeebe:Script')) {
278
282
  return getSupportedMessage('A <Script Task> with <Implementation: FEEL expression>', executionPlatform, executionPlatformVersion, allowedVersion);
279
283
  }
@@ -500,6 +504,15 @@ function getPropertyRequiredErrorMessage(report, executionPlatform, executionPla
500
504
  return `${ getIndefiniteArticle(typeString) } <${ typeString }> with <Form type: Custom form key> must have a defined <Form key>`;
501
505
  }
502
506
 
507
+ // Zeebe User Task
508
+ if (is(node, 'zeebe:FormDefinition') && isZeebeUserTask(parentNode)) {
509
+ if (isEmptyString(node.get('externalReference'))) {
510
+ return `${ getIndefiniteArticle(typeString) } <${ typeString }> with <Form type: External reference> must have a defined <External reference>`;
511
+ } else if (isEmptyString(node.get('formId'))) {
512
+ return `${ getIndefiniteArticle(typeString) } <${ typeString }> with <Form type: Camunda Form> must have a defined <Form ID>`;
513
+ }
514
+ }
515
+
503
516
  if (is(node, 'zeebe:FormDefinition') && isArray(requiredProperty) && requiredProperty.includes('formId') && isEmptyString(node.get('formId'))) {
504
517
  return `${ getIndefiniteArticle(typeString) } <${ typeString }> with <Form type: Camunda form (linked)> must have a defined <Form ID>`;
505
518
  }
@@ -693,4 +706,10 @@ function getLoopNotAllowedErrorMessage(report) {
693
706
 
694
707
  function isEmptyString(value) {
695
708
  return isString(value) && value.trim() === '';
696
- }
709
+ }
710
+
711
+ function isZeebeUserTask(node) {
712
+ return node.get('extensionElements').get('values').some(extensionElement => {
713
+ return is(extensionElement, 'zeebe:UserTask');
714
+ });
715
+ }
@@ -168,10 +168,14 @@ export function getEntryIds(report) {
168
168
  requiredProperty
169
169
  } = data;
170
170
 
171
- if (isArray(requiredProperty) && requiredProperty.includes('formKey') && isEmptyString(node.get('formKey'))) {
172
- return [ 'customFormKey' ];
173
- } else if (isArray(requiredProperty) && requiredProperty.includes('formId') && isEmptyString(node.get('formId'))) {
174
- return [ 'formId' ];
171
+ if (isArray(requiredProperty)) {
172
+ if (requiredProperty.includes('formKey') && isEmptyString(node.get('formKey'))) {
173
+ return [ 'customFormKey' ];
174
+ } else if (requiredProperty.includes('formId') && isEmptyString(node.get('formId'))) {
175
+ return [ 'formId' ];
176
+ } else if (requiredProperty.includes('externalReference') && isEmptyString(node.get('externalReference'))) {
177
+ return [ 'externalReference' ];
178
+ }
175
179
  }
176
180
  }
177
181
 
@@ -205,6 +209,10 @@ export function getEntryIds(report) {
205
209
  });
206
210
  }
207
211
 
212
+ if (isExtensionElementNotAllowedError(data, 'zeebe:UserTask')) {
213
+ return [ 'userTaskImplementation' ];
214
+ }
215
+
208
216
  if (isExtensionElementNotAllowedError(data, 'zeebe:FormDefinition', 'bpmn:StartEvent')) {
209
217
  return [ 'formType' ];
210
218
  }
@@ -424,6 +432,10 @@ export function getErrorMessage(id, report) {
424
432
  }
425
433
  }
426
434
 
435
+ if (id === 'externalReference') {
436
+ return 'External reference must be defined.';
437
+ }
438
+
427
439
  if (id === 'formConfiguration') {
428
440
  return 'Form JSON configuration must be defined.';
429
441
  }
@@ -436,6 +448,10 @@ export function getErrorMessage(id, report) {
436
448
  return 'Not supported.';
437
449
  }
438
450
 
451
+ if (id === 'userTaskImplementation') {
452
+ return 'Supported only in Camunda 8.5 or newer.';
453
+ }
454
+
439
455
  if (id === 'conditionExpression') {
440
456
  return 'Condition expression must be defined.';
441
457
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/linting",
3
- "version": "3.16.0",
3
+ "version": "3.17.0",
4
4
  "description": "Linting for Camunda",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -32,7 +32,7 @@
32
32
  "@bpmn-io/diagram-js-ui": "^0.2.2",
33
33
  "bpmn-moddle": "^8.1.0",
34
34
  "bpmnlint": "^10.2.0",
35
- "bpmnlint-plugin-camunda-compat": "^2.16.0",
35
+ "bpmnlint-plugin-camunda-compat": "^2.17.0",
36
36
  "bpmnlint-utils": "^1.0.2",
37
37
  "camunda-bpmn-moddle": "^7.0.1",
38
38
  "clsx": "^2.0.0",
@@ -40,13 +40,13 @@
40
40
  "min-dom": "^4.1.0",
41
41
  "modeler-moddle": "^0.2.0",
42
42
  "semver-compare": "^1.0.0",
43
- "zeebe-bpmn-moddle": "^1.0.0"
43
+ "zeebe-bpmn-moddle": "^1.1.0"
44
44
  },
45
45
  "devDependencies": {
46
46
  "bpmn-js": "^16.5.0",
47
47
  "bpmn-js-element-templates": "^1.13.1",
48
- "bpmn-js-properties-panel": "^5.11.1",
49
- "camunda-bpmn-js-behaviors": "^1.2.3",
48
+ "bpmn-js-properties-panel": "^5.13.0",
49
+ "camunda-bpmn-js-behaviors": "^1.3.0",
50
50
  "chai": "^4.4.1",
51
51
  "cross-env": "^7.0.3",
52
52
  "eslint": "^8.56.0",