bpmnlint-plugin-camunda-compat 2.17.0 → 2.19.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.
Files changed (50) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +39 -39
  3. package/index.js +221 -205
  4. package/package.json +53 -53
  5. package/rules/camunda-cloud/called-element.js +42 -42
  6. package/rules/camunda-cloud/collapsed-subprocess.js +40 -40
  7. package/rules/camunda-cloud/duplicate-task-headers.js +58 -58
  8. package/rules/camunda-cloud/element-type/config.js +66 -63
  9. package/rules/camunda-cloud/element-type/index.js +133 -133
  10. package/rules/camunda-cloud/error-reference.js +71 -71
  11. package/rules/camunda-cloud/escalation-boundary-event-attached-to-ref.js +48 -48
  12. package/rules/camunda-cloud/escalation-reference.js +66 -66
  13. package/rules/camunda-cloud/event-based-gateway-target.js +38 -38
  14. package/rules/camunda-cloud/executable-process.js +61 -61
  15. package/rules/camunda-cloud/feel.js +82 -82
  16. package/rules/camunda-cloud/implementation/config.js +16 -16
  17. package/rules/camunda-cloud/implementation/index.js +218 -218
  18. package/rules/camunda-cloud/inclusive-gateway.js +35 -35
  19. package/rules/camunda-cloud/link-event.js +142 -142
  20. package/rules/camunda-cloud/loop-characteristics.js +66 -66
  21. package/rules/camunda-cloud/message-reference.js +60 -60
  22. package/rules/camunda-cloud/no-candidate-users.js +38 -38
  23. package/rules/camunda-cloud/no-expression.js +173 -173
  24. package/rules/camunda-cloud/no-loop.js +145 -145
  25. package/rules/camunda-cloud/no-multiple-none-start-events.js +41 -41
  26. package/rules/camunda-cloud/no-propagate-all-parent-variables.js +44 -44
  27. package/rules/camunda-cloud/no-signal-event-sub-process.js +45 -45
  28. package/rules/camunda-cloud/no-task-schedule.js +18 -18
  29. package/rules/camunda-cloud/no-template.js +23 -23
  30. package/rules/camunda-cloud/no-zeebe-properties.js +18 -18
  31. package/rules/camunda-cloud/no-zeebe-user-task.js +27 -27
  32. package/rules/camunda-cloud/secrets.js +119 -119
  33. package/rules/camunda-cloud/sequence-flow-condition.js +56 -56
  34. package/rules/camunda-cloud/signal-reference.js +64 -64
  35. package/rules/camunda-cloud/start-event-form.js +97 -97
  36. package/rules/camunda-cloud/subscription.js +65 -65
  37. package/rules/camunda-cloud/task-schedule.js +67 -67
  38. package/rules/camunda-cloud/timer/config.js +46 -46
  39. package/rules/camunda-cloud/timer/index.js +183 -183
  40. package/rules/camunda-cloud/user-task-definition.js +24 -24
  41. package/rules/camunda-cloud/user-task-form.js +142 -142
  42. package/rules/camunda-cloud/wait-for-completion.js +46 -0
  43. package/rules/camunda-platform/history-time-to-live.js +19 -19
  44. package/rules/utils/cron.js +95 -95
  45. package/rules/utils/element.js +484 -484
  46. package/rules/utils/error-types.js +23 -23
  47. package/rules/utils/iso8601.js +52 -52
  48. package/rules/utils/reporter.js +37 -37
  49. package/rules/utils/rule.js +46 -46
  50. package/rules/utils/version.js +4 -4
package/package.json CHANGED
@@ -1,53 +1,53 @@
1
- {
2
- "name": "bpmnlint-plugin-camunda-compat",
3
- "version": "2.17.0",
4
- "description": "A bpmnlint plug-in for Camunda compatibility",
5
- "main": "index.js",
6
- "scripts": {
7
- "all": "npm run lint && npm test",
8
- "dev": "npm run test:watch",
9
- "lint": "eslint .",
10
- "test": "mocha 'test/**/*.spec.js'",
11
- "test:watch": "npm run test -- --watch"
12
- },
13
- "repository": {
14
- "type": "git",
15
- "url": "https://github.com/camunda/bpmnlint-plugin-camunda-compat"
16
- },
17
- "keywords": [
18
- "bpmnlint",
19
- "plugin"
20
- ],
21
- "author": {
22
- "name": "Philipp Fromme",
23
- "url": "https://github.com/philippfromme"
24
- },
25
- "license": "MIT",
26
- "devDependencies": {
27
- "bpmn-moddle": "^8.1.0",
28
- "bpmnlint": "^10.2.0",
29
- "camunda-bpmn-moddle": "^7.0.1",
30
- "chai": "^4.4.1",
31
- "eslint": "^8.56.0",
32
- "eslint-plugin-bpmn-io": "^1.0.0",
33
- "mocha": "^10.2.0",
34
- "modeler-moddle": "^0.2.0",
35
- "sinon": "^17.0.1",
36
- "sinon-chai": "^3.7.0",
37
- "zeebe-bpmn-moddle": "^1.1.0"
38
- },
39
- "dependencies": {
40
- "@bpmn-io/feel-lint": "^1.2.0",
41
- "@bpmn-io/moddle-utils": "^0.2.1",
42
- "bpmnlint-utils": "^1.0.2",
43
- "min-dash": "^4.1.1",
44
- "semver-compare": "^1.0.0"
45
- },
46
- "files": [
47
- "rules",
48
- "index.js"
49
- ],
50
- "engines": {
51
- "node": "*"
52
- }
53
- }
1
+ {
2
+ "name": "bpmnlint-plugin-camunda-compat",
3
+ "version": "2.19.0",
4
+ "description": "A bpmnlint plug-in for Camunda compatibility",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "all": "npm run lint && npm test",
8
+ "dev": "npm run test:watch",
9
+ "lint": "eslint .",
10
+ "test": "mocha 'test/**/*.spec.js'",
11
+ "test:watch": "npm run test -- --watch"
12
+ },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "https://github.com/camunda/bpmnlint-plugin-camunda-compat"
16
+ },
17
+ "keywords": [
18
+ "bpmnlint",
19
+ "plugin"
20
+ ],
21
+ "author": {
22
+ "name": "Philipp Fromme",
23
+ "url": "https://github.com/philippfromme"
24
+ },
25
+ "license": "MIT",
26
+ "devDependencies": {
27
+ "bpmn-moddle": "^8.1.0",
28
+ "bpmnlint": "^10.2.0",
29
+ "camunda-bpmn-moddle": "^7.0.1",
30
+ "chai": "^4.4.1",
31
+ "eslint": "^8.56.0",
32
+ "eslint-plugin-bpmn-io": "^1.0.0",
33
+ "mocha": "^10.2.0",
34
+ "modeler-moddle": "^0.2.0",
35
+ "sinon": "^17.0.1",
36
+ "sinon-chai": "^3.7.0",
37
+ "zeebe-bpmn-moddle": "^1.1.0"
38
+ },
39
+ "dependencies": {
40
+ "@bpmn-io/feel-lint": "^1.2.0",
41
+ "@bpmn-io/moddle-utils": "^0.2.1",
42
+ "bpmnlint-utils": "^1.0.2",
43
+ "min-dash": "^4.1.1",
44
+ "semver-compare": "^1.0.0"
45
+ },
46
+ "files": [
47
+ "rules",
48
+ "index.js"
49
+ ],
50
+ "engines": {
51
+ "node": "*"
52
+ }
53
+ }
@@ -1,43 +1,43 @@
1
- const { is } = require('bpmnlint-utils');
2
-
3
- const {
4
- findExtensionElement,
5
- hasExtensionElement,
6
- hasProperties
7
- } = require('../utils/element');
8
-
9
- const { reportErrors } = require('../utils/reporter');
10
-
11
- const { skipInNonExecutableProcess } = require('../utils/rule');
12
-
13
- module.exports = skipInNonExecutableProcess(function() {
14
- function check(node, reporter) {
15
- if (!is(node, 'bpmn:CallActivity')) {
16
- return;
17
- }
18
-
19
- let errors = hasExtensionElement(node, 'zeebe:CalledElement', node);
20
-
21
- if (errors && errors.length) {
22
- reportErrors(node, reporter, errors);
23
-
24
- return;
25
- }
26
-
27
- const calledElement = findExtensionElement(node, 'zeebe:CalledElement');
28
-
29
- errors = hasProperties(calledElement, {
30
- processId: {
31
- required: true
32
- }
33
- }, node);
34
-
35
- if (errors && errors.length) {
36
- reportErrors(node, reporter, errors);
37
- }
38
- }
39
-
40
- return {
41
- check
42
- };
1
+ const { is } = require('bpmnlint-utils');
2
+
3
+ const {
4
+ findExtensionElement,
5
+ hasExtensionElement,
6
+ hasProperties
7
+ } = require('../utils/element');
8
+
9
+ const { reportErrors } = require('../utils/reporter');
10
+
11
+ const { skipInNonExecutableProcess } = require('../utils/rule');
12
+
13
+ module.exports = skipInNonExecutableProcess(function() {
14
+ function check(node, reporter) {
15
+ if (!is(node, 'bpmn:CallActivity')) {
16
+ return;
17
+ }
18
+
19
+ let errors = hasExtensionElement(node, 'zeebe:CalledElement', node);
20
+
21
+ if (errors && errors.length) {
22
+ reportErrors(node, reporter, errors);
23
+
24
+ return;
25
+ }
26
+
27
+ const calledElement = findExtensionElement(node, 'zeebe:CalledElement');
28
+
29
+ errors = hasProperties(calledElement, {
30
+ processId: {
31
+ required: true
32
+ }
33
+ }, node);
34
+
35
+ if (errors && errors.length) {
36
+ reportErrors(node, reporter, errors);
37
+ }
38
+ }
39
+
40
+ return {
41
+ check
42
+ };
43
43
  });
@@ -1,40 +1,40 @@
1
- const { is } = require('bpmnlint-utils');
2
-
3
- const { ERROR_TYPES } = require('../utils/element');
4
-
5
- const { reportErrors } = require('../utils/reporter');
6
-
7
- const { skipInNonExecutableProcess } = require('../utils/rule');
8
-
9
- module.exports = skipInNonExecutableProcess(function() {
10
- function check(di, reporter) {
11
-
12
- if (!isCollapsedSubProcess(di)) {
13
- return;
14
- }
15
-
16
- const node = di.bpmnElement;
17
-
18
- const error = {
19
- message: `A <${ node.$type }> must be expanded`,
20
- data: {
21
- type: ERROR_TYPES.ELEMENT_COLLAPSED_NOT_ALLOWED,
22
- node: node,
23
- parentNode: null,
24
- allowedVersion: '8.4'
25
- }
26
- };
27
-
28
- reportErrors(node, reporter, error);
29
- }
30
-
31
- return {
32
- check
33
- };
34
- });
35
-
36
- function isCollapsedSubProcess(di) {
37
- return is(di, 'bpmndi:BPMNShape') &&
38
- is(di.get('bpmnElement'), 'bpmn:SubProcess') &&
39
- di.get('isExpanded') !== true;
40
- }
1
+ const { is } = require('bpmnlint-utils');
2
+
3
+ const { ERROR_TYPES } = require('../utils/element');
4
+
5
+ const { reportErrors } = require('../utils/reporter');
6
+
7
+ const { skipInNonExecutableProcess } = require('../utils/rule');
8
+
9
+ module.exports = skipInNonExecutableProcess(function() {
10
+ function check(di, reporter) {
11
+
12
+ if (!isCollapsedSubProcess(di)) {
13
+ return;
14
+ }
15
+
16
+ const node = di.bpmnElement;
17
+
18
+ const error = {
19
+ message: `A <${ node.$type }> must be expanded`,
20
+ data: {
21
+ type: ERROR_TYPES.ELEMENT_COLLAPSED_NOT_ALLOWED,
22
+ node: node,
23
+ parentNode: null,
24
+ allowedVersion: '8.4'
25
+ }
26
+ };
27
+
28
+ reportErrors(node, reporter, error);
29
+ }
30
+
31
+ return {
32
+ check
33
+ };
34
+ });
35
+
36
+ function isCollapsedSubProcess(di) {
37
+ return is(di, 'bpmndi:BPMNShape') &&
38
+ is(di.get('bpmnElement'), 'bpmn:SubProcess') &&
39
+ di.get('isExpanded') !== true;
40
+ }
@@ -1,59 +1,59 @@
1
- const {
2
- is,
3
- isAny
4
- } = require('bpmnlint-utils');
5
-
6
- const {
7
- findExtensionElement,
8
- getMessageEventDefinition,
9
- hasDuplicatedPropertyValues
10
- } = require('../utils/element');
11
-
12
- const { reportErrors } = require('../utils/reporter');
13
-
14
- const { skipInNonExecutableProcess } = require('../utils/rule');
15
-
16
- module.exports = skipInNonExecutableProcess(function() {
17
- function check(node, reporter) {
18
- if (!is(node, 'bpmn:UserTask') && !isZeebeServiceTask(node)) {
19
- return;
20
- }
21
-
22
- const taskHeaders = findExtensionElement(node, 'zeebe:TaskHeaders');
23
-
24
- if (!taskHeaders) {
25
- return;
26
- }
27
-
28
- const errors = hasDuplicatedPropertyValues(taskHeaders, 'values', 'key', node);
29
-
30
- if (errors && errors.length) {
31
- reportErrors(node, reporter, errors);
32
- }
33
- }
34
-
35
- return {
36
- check
37
- };
38
- });
39
-
40
- // helpers //////////
41
-
42
- function isZeebeServiceTask(element) {
43
- if (is(element, 'zeebe:ZeebeServiceTask')) {
44
- return true;
45
- }
46
-
47
- if (isAny(element, [
48
- 'bpmn:EndEvent',
49
- 'bpmn:IntermediateThrowEvent'
50
- ])) {
51
- return getMessageEventDefinition(element);
52
- }
53
-
54
- if (is(element, 'bpmn:BusinessRuleTask')) {
55
- return findExtensionElement(element, 'zeebe:TaskDefinition');
56
- }
57
-
58
- return false;
1
+ const {
2
+ is,
3
+ isAny
4
+ } = require('bpmnlint-utils');
5
+
6
+ const {
7
+ findExtensionElement,
8
+ getMessageEventDefinition,
9
+ hasDuplicatedPropertyValues
10
+ } = require('../utils/element');
11
+
12
+ const { reportErrors } = require('../utils/reporter');
13
+
14
+ const { skipInNonExecutableProcess } = require('../utils/rule');
15
+
16
+ module.exports = skipInNonExecutableProcess(function() {
17
+ function check(node, reporter) {
18
+ if (!is(node, 'bpmn:UserTask') && !isZeebeServiceTask(node)) {
19
+ return;
20
+ }
21
+
22
+ const taskHeaders = findExtensionElement(node, 'zeebe:TaskHeaders');
23
+
24
+ if (!taskHeaders) {
25
+ return;
26
+ }
27
+
28
+ const errors = hasDuplicatedPropertyValues(taskHeaders, 'values', 'key', node);
29
+
30
+ if (errors && errors.length) {
31
+ reportErrors(node, reporter, errors);
32
+ }
33
+ }
34
+
35
+ return {
36
+ check
37
+ };
38
+ });
39
+
40
+ // helpers //////////
41
+
42
+ function isZeebeServiceTask(element) {
43
+ if (is(element, 'zeebe:ZeebeServiceTask')) {
44
+ return true;
45
+ }
46
+
47
+ if (isAny(element, [
48
+ 'bpmn:EndEvent',
49
+ 'bpmn:IntermediateThrowEvent'
50
+ ])) {
51
+ return getMessageEventDefinition(element);
52
+ }
53
+
54
+ if (is(element, 'bpmn:BusinessRuleTask')) {
55
+ return findExtensionElement(element, 'zeebe:TaskDefinition');
56
+ }
57
+
58
+ return false;
59
59
  }
@@ -1,64 +1,67 @@
1
- module.exports = {
2
- 'bpmn:Association': '1.0',
3
- 'bpmn:BoundaryEvent': {
4
- 'bpmn:ErrorEventDefinition': '1.0',
5
- 'bpmn:EscalationEventDefinition': '8.2',
6
- 'bpmn:MessageEventDefinition': '1.0',
7
- 'bpmn:TimerEventDefinition': '1.0',
8
- 'bpmn:SignalEventDefinition': '8.3',
9
- },
10
- 'bpmn:BusinessRuleTask': '1.1',
11
- 'bpmn:CallActivity': '1.0',
12
- 'bpmn:Collaboration': '1.0',
13
- 'bpmn:DataObject': '8.0',
14
- 'bpmn:DataObjectReference': '8.0',
15
- 'bpmn:DataStoreReference': '8.0',
16
- 'bpmn:Definitions': '1.0',
17
- 'bpmn:EndEvent': {
18
- '_': '1.0',
19
- 'bpmn:ErrorEventDefinition': '1.0',
20
- 'bpmn:EscalationEventDefinition': '8.2',
21
- 'bpmn:MessageEventDefinition': '1.2',
22
- 'bpmn:SignalEventDefinition': '8.3',
23
- 'bpmn:TerminateEventDefinition': '8.1'
24
- },
25
- 'bpmn:EventBasedGateway': '1.0',
26
- 'bpmn:ExclusiveGateway': '1.0',
27
- 'bpmn:Group': '1.0',
28
- 'bpmn:InclusiveGateway': '8.1',
29
- 'bpmn:IntermediateCatchEvent': {
30
- 'bpmn:MessageEventDefinition': '1.0',
31
- 'bpmn:LinkEventDefinition': '8.2',
32
- 'bpmn:TimerEventDefinition': '1.0',
33
- 'bpmn:SignalEventDefinition': '8.3'
34
- },
35
- 'bpmn:IntermediateThrowEvent': {
36
- '_': '1.1',
37
- 'bpmn:EscalationEventDefinition': '8.2',
38
- 'bpmn:LinkEventDefinition': '8.2',
39
- 'bpmn:MessageEventDefinition': '1.2',
40
- 'bpmn:SignalEventDefinition': '8.3'
41
- },
42
- 'bpmn:ManualTask': '1.1',
43
- 'bpmn:MessageFlow': '1.0',
44
- 'bpmn:ParallelGateway': '1.0',
45
- 'bpmn:Participant': '1.0',
46
- 'bpmn:Process': '1.0',
47
- 'bpmn:ReceiveTask': '1.0',
48
- 'bpmn:ScriptTask': '1.1',
49
- 'bpmn:SendTask': '1.1',
50
- 'bpmn:SequenceFlow': '1.0',
51
- 'bpmn:ServiceTask': '1.0',
52
- 'bpmn:StartEvent': {
53
- '_': '1.0',
54
- 'bpmn:ErrorEventDefinition': '1.0',
55
- 'bpmn:EscalationEventDefinition': '8.2',
56
- 'bpmn:MessageEventDefinition': '1.0',
57
- 'bpmn:SignalEventDefinition': '8.2',
58
- 'bpmn:TimerEventDefinition': '1.0'
59
- },
60
- 'bpmn:SubProcess': '1.0',
61
- 'bpmn:Task': '8.2',
62
- 'bpmn:TextAnnotation': '1.0',
63
- 'bpmn:UserTask': '1.0'
1
+ module.exports = {
2
+ 'bpmn:Association': '1.0',
3
+ 'bpmn:BoundaryEvent': {
4
+ 'bpmn:CompensateEventDefinition': '8.5',
5
+ 'bpmn:ErrorEventDefinition': '1.0',
6
+ 'bpmn:EscalationEventDefinition': '8.2',
7
+ 'bpmn:MessageEventDefinition': '1.0',
8
+ 'bpmn:TimerEventDefinition': '1.0',
9
+ 'bpmn:SignalEventDefinition': '8.3',
10
+ },
11
+ 'bpmn:BusinessRuleTask': '1.1',
12
+ 'bpmn:CallActivity': '1.0',
13
+ 'bpmn:Collaboration': '1.0',
14
+ 'bpmn:DataObject': '8.0',
15
+ 'bpmn:DataObjectReference': '8.0',
16
+ 'bpmn:DataStoreReference': '8.0',
17
+ 'bpmn:Definitions': '1.0',
18
+ 'bpmn:EndEvent': {
19
+ '_': '1.0',
20
+ 'bpmn:CompensateEventDefinition': '8.5',
21
+ 'bpmn:ErrorEventDefinition': '1.0',
22
+ 'bpmn:EscalationEventDefinition': '8.2',
23
+ 'bpmn:MessageEventDefinition': '1.2',
24
+ 'bpmn:SignalEventDefinition': '8.3',
25
+ 'bpmn:TerminateEventDefinition': '8.1'
26
+ },
27
+ 'bpmn:EventBasedGateway': '1.0',
28
+ 'bpmn:ExclusiveGateway': '1.0',
29
+ 'bpmn:Group': '1.0',
30
+ 'bpmn:InclusiveGateway': '8.1',
31
+ 'bpmn:IntermediateCatchEvent': {
32
+ 'bpmn:MessageEventDefinition': '1.0',
33
+ 'bpmn:LinkEventDefinition': '8.2',
34
+ 'bpmn:TimerEventDefinition': '1.0',
35
+ 'bpmn:SignalEventDefinition': '8.3'
36
+ },
37
+ 'bpmn:IntermediateThrowEvent': {
38
+ '_': '1.1',
39
+ 'bpmn:CompensateEventDefinition': '8.5',
40
+ 'bpmn:EscalationEventDefinition': '8.2',
41
+ 'bpmn:LinkEventDefinition': '8.2',
42
+ 'bpmn:MessageEventDefinition': '1.2',
43
+ 'bpmn:SignalEventDefinition': '8.3'
44
+ },
45
+ 'bpmn:ManualTask': '1.1',
46
+ 'bpmn:MessageFlow': '1.0',
47
+ 'bpmn:ParallelGateway': '1.0',
48
+ 'bpmn:Participant': '1.0',
49
+ 'bpmn:Process': '1.0',
50
+ 'bpmn:ReceiveTask': '1.0',
51
+ 'bpmn:ScriptTask': '1.1',
52
+ 'bpmn:SendTask': '1.1',
53
+ 'bpmn:SequenceFlow': '1.0',
54
+ 'bpmn:ServiceTask': '1.0',
55
+ 'bpmn:StartEvent': {
56
+ '_': '1.0',
57
+ 'bpmn:ErrorEventDefinition': '1.0',
58
+ 'bpmn:EscalationEventDefinition': '8.2',
59
+ 'bpmn:MessageEventDefinition': '1.0',
60
+ 'bpmn:SignalEventDefinition': '8.2',
61
+ 'bpmn:TimerEventDefinition': '1.0'
62
+ },
63
+ 'bpmn:SubProcess': '1.0',
64
+ 'bpmn:Task': '8.2',
65
+ 'bpmn:TextAnnotation': '1.0',
66
+ 'bpmn:UserTask': '1.0'
64
67
  };