bpmnlint-plugin-camunda-compat 2.20.2 → 2.21.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.
Files changed (52) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +39 -39
  3. package/index.js +224 -223
  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/connector-properties/config.js +90 -90
  8. package/rules/camunda-cloud/connector-properties/index.js +47 -47
  9. package/rules/camunda-cloud/duplicate-task-headers.js +58 -58
  10. package/rules/camunda-cloud/element-type/config.js +66 -66
  11. package/rules/camunda-cloud/element-type/index.js +133 -133
  12. package/rules/camunda-cloud/error-reference.js +71 -71
  13. package/rules/camunda-cloud/escalation-boundary-event-attached-to-ref.js +48 -48
  14. package/rules/camunda-cloud/escalation-reference.js +66 -66
  15. package/rules/camunda-cloud/event-based-gateway-target.js +38 -38
  16. package/rules/camunda-cloud/executable-process.js +61 -61
  17. package/rules/camunda-cloud/feel.js +82 -82
  18. package/rules/camunda-cloud/implementation/config.js +16 -16
  19. package/rules/camunda-cloud/implementation/index.js +218 -218
  20. package/rules/camunda-cloud/inclusive-gateway.js +35 -35
  21. package/rules/camunda-cloud/link-event.js +142 -142
  22. package/rules/camunda-cloud/loop-characteristics.js +66 -66
  23. package/rules/camunda-cloud/message-reference.js +60 -60
  24. package/rules/camunda-cloud/no-candidate-users.js +38 -38
  25. package/rules/camunda-cloud/no-expression.js +173 -173
  26. package/rules/camunda-cloud/no-loop.js +316 -145
  27. package/rules/camunda-cloud/no-multiple-none-start-events.js +41 -41
  28. package/rules/camunda-cloud/no-propagate-all-parent-variables.js +44 -44
  29. package/rules/camunda-cloud/no-signal-event-sub-process.js +45 -45
  30. package/rules/camunda-cloud/no-task-schedule.js +18 -18
  31. package/rules/camunda-cloud/no-template.js +23 -23
  32. package/rules/camunda-cloud/no-zeebe-properties.js +18 -18
  33. package/rules/camunda-cloud/no-zeebe-user-task.js +27 -27
  34. package/rules/camunda-cloud/secrets.js +119 -119
  35. package/rules/camunda-cloud/sequence-flow-condition.js +56 -56
  36. package/rules/camunda-cloud/signal-reference.js +64 -64
  37. package/rules/camunda-cloud/start-event-form.js +97 -97
  38. package/rules/camunda-cloud/subscription.js +65 -65
  39. package/rules/camunda-cloud/task-schedule.js +67 -67
  40. package/rules/camunda-cloud/timer/config.js +46 -46
  41. package/rules/camunda-cloud/timer/index.js +183 -183
  42. package/rules/camunda-cloud/user-task-definition.js +24 -24
  43. package/rules/camunda-cloud/user-task-form.js +142 -142
  44. package/rules/camunda-cloud/wait-for-completion.js +46 -46
  45. package/rules/camunda-platform/history-time-to-live.js +19 -19
  46. package/rules/utils/cron.js +95 -95
  47. package/rules/utils/element.js +484 -484
  48. package/rules/utils/error-types.js +24 -24
  49. package/rules/utils/iso8601.js +52 -52
  50. package/rules/utils/reporter.js +37 -37
  51. package/rules/utils/rule.js +46 -46
  52. package/rules/utils/version.js +4 -4
@@ -1,143 +1,143 @@
1
- const { getPath } = require('@bpmn-io/moddle-utils');
2
-
3
- const {
4
- is,
5
- isAny
6
- } = require('bpmnlint-utils');
7
-
8
- const {
9
- getEventDefinition,
10
- hasProperties
11
- } = require('../utils/element');
12
-
13
- const { ERROR_TYPES } = require('../utils/error-types');
14
-
15
- const { reportErrors } = require('../utils/reporter');
16
-
17
- const { skipInNonExecutableProcess } = require('../utils/rule');
18
-
19
- module.exports = skipInNonExecutableProcess(function() {
20
- function check(node, reporter) {
21
-
22
- // check for duplicate link catch event names
23
- if (is(node, 'bpmn:Process')) {
24
- const linkCatchEvents = getLinkCatchEvents(node);
25
-
26
- const { duplicateNames } = linkCatchEvents.reduce(({ duplicateNames, names }, linkCatchEvent, index) => {
27
- const linkEventDefinition = getEventDefinition(linkCatchEvent, 'bpmn:LinkEventDefinition');
28
-
29
- const name = linkEventDefinition.get('name');
30
-
31
- names = [
32
- ...names,
33
- name
34
- ];
35
-
36
- if (!name) {
37
- return {
38
- duplicateNames,
39
- names
40
- };
41
- }
42
-
43
- if (names.indexOf(name) !== index && !duplicateNames.includes(name)) {
44
- duplicateNames = [
45
- ...duplicateNames,
46
- name
47
- ];
48
- }
49
-
50
- return {
51
- duplicateNames,
52
- names
53
- };
54
- }, {
55
- duplicateNames: [],
56
- names: []
57
- });
58
-
59
- duplicateNames.forEach((name) => {
60
- const duplicates = linkCatchEvents
61
- .filter(linkCatchEvent => {
62
- const linkEventDefinition = getEventDefinition(linkCatchEvent, 'bpmn:LinkEventDefinition');
63
-
64
- return linkEventDefinition.get('name') === name;
65
- });
66
-
67
- duplicates
68
- .forEach(linkCatchEvent => {
69
- const linkEventDefinition = getEventDefinition(linkCatchEvent, 'bpmn:LinkEventDefinition');
70
-
71
- const path = getPath(linkEventDefinition, linkCatchEvent);
72
-
73
- reportErrors(linkCatchEvent, reporter, {
74
- message: `Property of type <bpmn:LinkEventDefinition> has property <name> with duplicate value of <${ name }>`,
75
- path: path
76
- ? [ ...path, 'name' ]
77
- : [ 'name' ],
78
- data: {
79
- type: ERROR_TYPES.ELEMENT_PROPERTY_VALUE_DUPLICATED,
80
- node: linkEventDefinition,
81
- parentNode: linkCatchEvent,
82
- duplicatedProperty: 'name',
83
- duplicatedPropertyValue: name
84
- }
85
- });
86
- });
87
- });
88
- }
89
-
90
- // check for missing link catch & throw event names
91
- if (isLinkEvent(node)) {
92
- const linkEventDefinition = getEventDefinition(node);
93
-
94
- const errors = hasProperties(linkEventDefinition, {
95
- name: {
96
- required: true
97
- }
98
- }, node);
99
-
100
- if (errors.length) {
101
- reportErrors(node, reporter, errors);
102
- }
103
- }
104
- }
105
-
106
- return {
107
- check
108
- };
109
- });
110
-
111
- function isLinkEvent(element) {
112
- const eventDefinition = getEventDefinition(element);
113
-
114
- return isAny(element, [
115
- 'bpmn:IntermediateCatchEvent',
116
- 'bpmn:IntermediateThrowEvent'
117
- ]) && eventDefinition && is(eventDefinition, 'bpmn:LinkEventDefinition');
118
- }
119
-
120
- function isLinkCatchEvent(element) {
121
- const eventDefinition = getEventDefinition(element);
122
-
123
- return is(element, 'bpmn:IntermediateCatchEvent')
124
- && eventDefinition && is(eventDefinition, 'bpmn:LinkEventDefinition');
125
- }
126
-
127
- function getLinkCatchEvents(flowElementsContainer) {
128
- return flowElementsContainer.get('flowElements').reduce((linkCatchEvents, flowElement) => {
129
- if (isLinkCatchEvent(flowElement)) {
130
- return [
131
- ...linkCatchEvents,
132
- flowElement
133
- ];
134
- } else if (is(flowElement, 'bpmn:SubProcess')) {
135
- return [
136
- ...linkCatchEvents,
137
- ...getLinkCatchEvents(flowElement)
138
- ];
139
- }
140
-
141
- return linkCatchEvents;
142
- }, []);
1
+ const { getPath } = require('@bpmn-io/moddle-utils');
2
+
3
+ const {
4
+ is,
5
+ isAny
6
+ } = require('bpmnlint-utils');
7
+
8
+ const {
9
+ getEventDefinition,
10
+ hasProperties
11
+ } = require('../utils/element');
12
+
13
+ const { ERROR_TYPES } = require('../utils/error-types');
14
+
15
+ const { reportErrors } = require('../utils/reporter');
16
+
17
+ const { skipInNonExecutableProcess } = require('../utils/rule');
18
+
19
+ module.exports = skipInNonExecutableProcess(function() {
20
+ function check(node, reporter) {
21
+
22
+ // check for duplicate link catch event names
23
+ if (is(node, 'bpmn:Process')) {
24
+ const linkCatchEvents = getLinkCatchEvents(node);
25
+
26
+ const { duplicateNames } = linkCatchEvents.reduce(({ duplicateNames, names }, linkCatchEvent, index) => {
27
+ const linkEventDefinition = getEventDefinition(linkCatchEvent, 'bpmn:LinkEventDefinition');
28
+
29
+ const name = linkEventDefinition.get('name');
30
+
31
+ names = [
32
+ ...names,
33
+ name
34
+ ];
35
+
36
+ if (!name) {
37
+ return {
38
+ duplicateNames,
39
+ names
40
+ };
41
+ }
42
+
43
+ if (names.indexOf(name) !== index && !duplicateNames.includes(name)) {
44
+ duplicateNames = [
45
+ ...duplicateNames,
46
+ name
47
+ ];
48
+ }
49
+
50
+ return {
51
+ duplicateNames,
52
+ names
53
+ };
54
+ }, {
55
+ duplicateNames: [],
56
+ names: []
57
+ });
58
+
59
+ duplicateNames.forEach((name) => {
60
+ const duplicates = linkCatchEvents
61
+ .filter(linkCatchEvent => {
62
+ const linkEventDefinition = getEventDefinition(linkCatchEvent, 'bpmn:LinkEventDefinition');
63
+
64
+ return linkEventDefinition.get('name') === name;
65
+ });
66
+
67
+ duplicates
68
+ .forEach(linkCatchEvent => {
69
+ const linkEventDefinition = getEventDefinition(linkCatchEvent, 'bpmn:LinkEventDefinition');
70
+
71
+ const path = getPath(linkEventDefinition, linkCatchEvent);
72
+
73
+ reportErrors(linkCatchEvent, reporter, {
74
+ message: `Property of type <bpmn:LinkEventDefinition> has property <name> with duplicate value of <${ name }>`,
75
+ path: path
76
+ ? [ ...path, 'name' ]
77
+ : [ 'name' ],
78
+ data: {
79
+ type: ERROR_TYPES.ELEMENT_PROPERTY_VALUE_DUPLICATED,
80
+ node: linkEventDefinition,
81
+ parentNode: linkCatchEvent,
82
+ duplicatedProperty: 'name',
83
+ duplicatedPropertyValue: name
84
+ }
85
+ });
86
+ });
87
+ });
88
+ }
89
+
90
+ // check for missing link catch & throw event names
91
+ if (isLinkEvent(node)) {
92
+ const linkEventDefinition = getEventDefinition(node);
93
+
94
+ const errors = hasProperties(linkEventDefinition, {
95
+ name: {
96
+ required: true
97
+ }
98
+ }, node);
99
+
100
+ if (errors.length) {
101
+ reportErrors(node, reporter, errors);
102
+ }
103
+ }
104
+ }
105
+
106
+ return {
107
+ check
108
+ };
109
+ });
110
+
111
+ function isLinkEvent(element) {
112
+ const eventDefinition = getEventDefinition(element);
113
+
114
+ return isAny(element, [
115
+ 'bpmn:IntermediateCatchEvent',
116
+ 'bpmn:IntermediateThrowEvent'
117
+ ]) && eventDefinition && is(eventDefinition, 'bpmn:LinkEventDefinition');
118
+ }
119
+
120
+ function isLinkCatchEvent(element) {
121
+ const eventDefinition = getEventDefinition(element);
122
+
123
+ return is(element, 'bpmn:IntermediateCatchEvent')
124
+ && eventDefinition && is(eventDefinition, 'bpmn:LinkEventDefinition');
125
+ }
126
+
127
+ function getLinkCatchEvents(flowElementsContainer) {
128
+ return flowElementsContainer.get('flowElements').reduce((linkCatchEvents, flowElement) => {
129
+ if (isLinkCatchEvent(flowElement)) {
130
+ return [
131
+ ...linkCatchEvents,
132
+ flowElement
133
+ ];
134
+ } else if (is(flowElement, 'bpmn:SubProcess')) {
135
+ return [
136
+ ...linkCatchEvents,
137
+ ...getLinkCatchEvents(flowElement)
138
+ ];
139
+ }
140
+
141
+ return linkCatchEvents;
142
+ }, []);
143
143
  }
@@ -1,67 +1,67 @@
1
- const { is } = require('bpmnlint-utils');
2
-
3
- const {
4
- findExtensionElement,
5
- hasProperties,
6
- hasExtensionElement
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:Activity')) {
16
- return;
17
- }
18
-
19
- let loopCharacteristics = node.get('loopCharacteristics');
20
-
21
- if (!loopCharacteristics) {
22
- return;
23
- }
24
-
25
- let errors = hasProperties(node, {
26
- loopCharacteristics: {
27
- type: 'bpmn:MultiInstanceLoopCharacteristics'
28
- }
29
- }, node);
30
-
31
- if (errors && errors.length) {
32
- reportErrors(node, reporter, errors);
33
-
34
- return;
35
- }
36
-
37
- errors = hasExtensionElement(loopCharacteristics, 'zeebe:LoopCharacteristics', node);
38
-
39
- if (errors && errors.length) {
40
- reportErrors(node, reporter, errors);
41
-
42
- return;
43
- }
44
-
45
- loopCharacteristics = findExtensionElement(loopCharacteristics, 'zeebe:LoopCharacteristics');
46
-
47
- errors = hasProperties(loopCharacteristics, {
48
- inputCollection: {
49
- required: true
50
- },
51
- outputCollection: {
52
- dependentRequired: 'outputElement'
53
- },
54
- outputElement: {
55
- dependentRequired: 'outputCollection'
56
- }
57
- }, node);
58
-
59
- if (errors && errors.length) {
60
- reportErrors(node, reporter, errors);
61
- }
62
- }
63
-
64
- return {
65
- check
66
- };
1
+ const { is } = require('bpmnlint-utils');
2
+
3
+ const {
4
+ findExtensionElement,
5
+ hasProperties,
6
+ hasExtensionElement
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:Activity')) {
16
+ return;
17
+ }
18
+
19
+ let loopCharacteristics = node.get('loopCharacteristics');
20
+
21
+ if (!loopCharacteristics) {
22
+ return;
23
+ }
24
+
25
+ let errors = hasProperties(node, {
26
+ loopCharacteristics: {
27
+ type: 'bpmn:MultiInstanceLoopCharacteristics'
28
+ }
29
+ }, node);
30
+
31
+ if (errors && errors.length) {
32
+ reportErrors(node, reporter, errors);
33
+
34
+ return;
35
+ }
36
+
37
+ errors = hasExtensionElement(loopCharacteristics, 'zeebe:LoopCharacteristics', node);
38
+
39
+ if (errors && errors.length) {
40
+ reportErrors(node, reporter, errors);
41
+
42
+ return;
43
+ }
44
+
45
+ loopCharacteristics = findExtensionElement(loopCharacteristics, 'zeebe:LoopCharacteristics');
46
+
47
+ errors = hasProperties(loopCharacteristics, {
48
+ inputCollection: {
49
+ required: true
50
+ },
51
+ outputCollection: {
52
+ dependentRequired: 'outputElement'
53
+ },
54
+ outputElement: {
55
+ dependentRequired: 'outputCollection'
56
+ }
57
+ }, node);
58
+
59
+ if (errors && errors.length) {
60
+ reportErrors(node, reporter, errors);
61
+ }
62
+ }
63
+
64
+ return {
65
+ check
66
+ };
67
67
  });
@@ -1,61 +1,61 @@
1
- const {
2
- is,
3
- isAny
4
- } = require('bpmnlint-utils');
5
-
6
- const {
7
- getEventDefinition,
8
- hasProperties
9
- } = require('../utils/element');
10
-
11
- const { reportErrors } = require('../utils/reporter');
12
-
13
- const { skipInNonExecutableProcess } = require('../utils/rule');
14
-
15
- module.exports = skipInNonExecutableProcess(function() {
16
- function check(node, reporter) {
17
- if (!isAny(node, [ 'bpmn:CatchEvent', 'bpmn:ReceiveTask' ])) {
18
- return;
19
- }
20
-
21
- let eventDefinitionOrReceiveTask = node;
22
-
23
- if (!is(node, 'bpmn:ReceiveTask')) {
24
- const eventDefinition = getEventDefinition(node);
25
-
26
- if (!eventDefinition || !is(eventDefinition, 'bpmn:MessageEventDefinition')) {
27
- return;
28
- }
29
-
30
- eventDefinitionOrReceiveTask = eventDefinition;
31
- }
32
-
33
- let errors = hasProperties(eventDefinitionOrReceiveTask, {
34
- messageRef: {
35
- required: true
36
- }
37
- }, node);
38
-
39
- if (errors && errors.length) {
40
- reportErrors(node, reporter, errors);
41
-
42
- return;
43
- }
44
-
45
- const messageRef = eventDefinitionOrReceiveTask.get('messageRef');
46
-
47
- errors = hasProperties(messageRef, {
48
- name: {
49
- required: true
50
- }
51
- }, node);
52
-
53
- if (errors && errors.length) {
54
- reportErrors(node, reporter, errors);
55
- }
56
- }
57
-
58
- return {
59
- check
60
- };
1
+ const {
2
+ is,
3
+ isAny
4
+ } = require('bpmnlint-utils');
5
+
6
+ const {
7
+ getEventDefinition,
8
+ hasProperties
9
+ } = require('../utils/element');
10
+
11
+ const { reportErrors } = require('../utils/reporter');
12
+
13
+ const { skipInNonExecutableProcess } = require('../utils/rule');
14
+
15
+ module.exports = skipInNonExecutableProcess(function() {
16
+ function check(node, reporter) {
17
+ if (!isAny(node, [ 'bpmn:CatchEvent', 'bpmn:ReceiveTask' ])) {
18
+ return;
19
+ }
20
+
21
+ let eventDefinitionOrReceiveTask = node;
22
+
23
+ if (!is(node, 'bpmn:ReceiveTask')) {
24
+ const eventDefinition = getEventDefinition(node);
25
+
26
+ if (!eventDefinition || !is(eventDefinition, 'bpmn:MessageEventDefinition')) {
27
+ return;
28
+ }
29
+
30
+ eventDefinitionOrReceiveTask = eventDefinition;
31
+ }
32
+
33
+ let errors = hasProperties(eventDefinitionOrReceiveTask, {
34
+ messageRef: {
35
+ required: true
36
+ }
37
+ }, node);
38
+
39
+ if (errors && errors.length) {
40
+ reportErrors(node, reporter, errors);
41
+
42
+ return;
43
+ }
44
+
45
+ const messageRef = eventDefinitionOrReceiveTask.get('messageRef');
46
+
47
+ errors = hasProperties(messageRef, {
48
+ name: {
49
+ required: true
50
+ }
51
+ }, node);
52
+
53
+ if (errors && errors.length) {
54
+ reportErrors(node, reporter, errors);
55
+ }
56
+ }
57
+
58
+ return {
59
+ check
60
+ };
61
61
  });
@@ -1,39 +1,39 @@
1
- const { is } = require('bpmnlint-utils');
2
-
3
- const {
4
- findExtensionElement,
5
- hasProperties
6
- } = require('../utils/element');
7
-
8
- const { reportErrors } = require('../utils/reporter');
9
-
10
- const { skipInNonExecutableProcess } = require('../utils/rule');
11
-
12
- module.exports = skipInNonExecutableProcess(function() {
13
- function check(node, reporter) {
14
- if (!is(node, 'bpmn:UserTask')) {
15
- return;
16
- }
17
-
18
- const assignmentDefinition = findExtensionElement(node, 'zeebe:AssignmentDefinition');
19
-
20
- if (!assignmentDefinition) {
21
- return;
22
- }
23
-
24
- const errors = hasProperties(assignmentDefinition, {
25
- candidateUsers: {
26
- allowed: false,
27
- allowedVersion: '8.2'
28
- }
29
- }, node);
30
-
31
- if (errors && errors.length) {
32
- reportErrors(node, reporter, errors);
33
- }
34
- }
35
-
36
- return {
37
- check
38
- };
1
+ const { is } = require('bpmnlint-utils');
2
+
3
+ const {
4
+ findExtensionElement,
5
+ hasProperties
6
+ } = require('../utils/element');
7
+
8
+ const { reportErrors } = require('../utils/reporter');
9
+
10
+ const { skipInNonExecutableProcess } = require('../utils/rule');
11
+
12
+ module.exports = skipInNonExecutableProcess(function() {
13
+ function check(node, reporter) {
14
+ if (!is(node, 'bpmn:UserTask')) {
15
+ return;
16
+ }
17
+
18
+ const assignmentDefinition = findExtensionElement(node, 'zeebe:AssignmentDefinition');
19
+
20
+ if (!assignmentDefinition) {
21
+ return;
22
+ }
23
+
24
+ const errors = hasProperties(assignmentDefinition, {
25
+ candidateUsers: {
26
+ allowed: false,
27
+ allowedVersion: '8.2'
28
+ }
29
+ }, node);
30
+
31
+ if (errors && errors.length) {
32
+ reportErrors(node, reporter, errors);
33
+ }
34
+ }
35
+
36
+ return {
37
+ check
38
+ };
39
39
  });