@camunda/linting 1.0.0 → 1.2.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.
@@ -123,6 +123,10 @@ export function getErrorMessage(report, executionPlatform, executionPlatformVers
123
123
  return getExpressionNotAllowedErrorMessage(report);
124
124
  }
125
125
 
126
+ if (type === ERROR_TYPES.EVENT_BASED_GATEWAY_TARGET_NOT_ALLOWED) {
127
+ return getEventBasedGatewayTargetNotAllowedErrorMessage(report);
128
+ }
129
+
126
130
  return message;
127
131
  }
128
132
 
@@ -353,6 +357,10 @@ function getPropertyNotAllowedErrorMessage(report, executionPlatform, executionP
353
357
  return getSupportedMessage(`${ getIndefiniteArticle(typeString) } <${ typeString }> with defined <Candidate users>`, executionPlatform, executionPlatformVersion, allowedVersion);
354
358
  }
355
359
 
360
+ if (is(node, 'bpmn:SequenceFlow') && property === 'conditionExpression') {
361
+ return `${ getIndefiniteArticle(typeString) } <${ typeString }> with <Condition expression> is only supported if the source is an <Exclusive Gateway> or <Inclusive Gateway>`;
362
+ }
363
+
356
364
  return message;
357
365
  }
358
366
 
@@ -412,6 +420,10 @@ function getPropertyRequiredErrorMessage(report, executionPlatform, executionPla
412
420
  return `${ getIndefiniteArticle(typeString) } <${ typeString }> with <Message Reference> must have a defined <Name>`;
413
421
  }
414
422
 
423
+ if (is(node, 'bpmn:Signal') && requiredProperty === 'name') {
424
+ return `${ getIndefiniteArticle(typeString) } <${ typeString }> with <Signal Reference> must have a defined <Name>`;
425
+ }
426
+
415
427
  if (is(node, 'zeebe:Subscription') && requiredProperty === 'correlationKey') {
416
428
  return `${ getIndefiniteArticle(typeString) } <${ typeString }> with <Message Reference> must have a defined <Subscription correlation key>`;
417
429
  }
@@ -434,6 +446,10 @@ function getPropertyRequiredErrorMessage(report, executionPlatform, executionPla
434
446
  return `${ getIndefiniteArticle(typeString) } <${ typeString }> must have a defined <Message Reference>`;
435
447
  }
436
448
 
449
+ if (requiredProperty === 'signalRef') {
450
+ return `${ getIndefiniteArticle(typeString) } <${ typeString }> must have a defined <Signal Reference>`;
451
+ }
452
+
437
453
  if (is(node, 'zeebe:FormDefinition') && requiredProperty === 'formKey') {
438
454
  return `${ getIndefiniteArticle(typeString) } <${ typeString }> with <Form type: Custom form key> must have a defined <Form key>`;
439
455
  }
@@ -547,5 +563,17 @@ function getExpressionNotAllowedErrorMessage(report) {
547
563
  return 'Error code used in a catch event must be a static value';
548
564
  }
549
565
 
566
+ return report.message;
567
+ }
568
+
569
+ function getEventBasedGatewayTargetNotAllowedErrorMessage(report) {
570
+ const { data } = report;
571
+
572
+ const { node } = data;
573
+
574
+ if (is(node, 'bpmn:ReceiveTask')) {
575
+ return 'A <Receive Task> cannot be the target of an <Event-Based Gateway>';
576
+ }
577
+
550
578
  return report.message;
551
579
  }
@@ -76,6 +76,10 @@ export function getEntryIds(report) {
76
76
  return [ 'messageRef' ];
77
77
  }
78
78
 
79
+ if (isPropertyError(data, 'signalRef')) {
80
+ return [ 'signalRef' ];
81
+ }
82
+
79
83
  if (isPropertyError(data, 'decisionId', 'zeebe:CalledDecision')) {
80
84
  return [ 'decisionId' ];
81
85
  }
@@ -100,6 +104,10 @@ export function getEntryIds(report) {
100
104
  return [ 'messageName' ];
101
105
  }
102
106
 
107
+ if (isPropertyError(data, 'name', 'bpmn:Signal')) {
108
+ return [ 'signalName' ];
109
+ }
110
+
103
111
  if (isExtensionElementRequiredError(data, 'zeebe:LoopCharacteristics', 'bpmn:MultiInstanceLoopCharacteristics')
104
112
  || isPropertyError(data, 'inputCollection', 'zeebe:LoopCharacteristics')) {
105
113
  return [ 'multiInstance-inputCollection' ];
@@ -286,6 +294,10 @@ export function getErrorMessage(id, report) {
286
294
  return 'Global message reference must be defined.';
287
295
  }
288
296
 
297
+ if (id === 'signalRef') {
298
+ return 'Global signal reference must be defined.';
299
+ }
300
+
289
301
  if (id === 'decisionId') {
290
302
  return 'Decision ID must be defined.';
291
303
  }
@@ -310,6 +322,10 @@ export function getErrorMessage(id, report) {
310
322
  return 'Name must be defined.';
311
323
  }
312
324
 
325
+ if (id === 'signalName') {
326
+ return 'Name must be defined.';
327
+ }
328
+
313
329
  if (id === 'multiInstance-inputCollection') {
314
330
  return 'Input collection must be defined.';
315
331
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/linting",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "description": "Linting for Camunda Platform",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -29,7 +29,7 @@
29
29
  "dependencies": {
30
30
  "bpmn-moddle": "^8.0.0",
31
31
  "bpmnlint": "^8.0.0",
32
- "bpmnlint-plugin-camunda-compat": "^1.0.1",
32
+ "bpmnlint-plugin-camunda-compat": "^1.2.0",
33
33
  "bpmnlint-utils": "^1.0.2",
34
34
  "min-dash": "^4.0.0",
35
35
  "min-dom": "^4.1.0",