bpmnlint-plugin-camunda-compat 2.20.2 → 2.21.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 (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 +145 -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,41 +1,41 @@
1
- const { is } = require('bpmnlint-utils');
2
-
3
- const { reportErrors } = require('../utils/reporter');
4
-
5
- const { ERROR_TYPES } = require('../utils/element');
6
-
7
- const { skipInNonExecutableProcess } = require('../utils/rule');
8
-
9
- module.exports = skipInNonExecutableProcess(function() {
10
- function check(node, reporter) {
11
- if (!is(node, 'bpmn:Process')) {
12
- return;
13
- }
14
-
15
- const flowElements = node.get('flowElements') || [];
16
-
17
- const noneStartEvents = flowElements.filter(flowElement => {
18
- return is(flowElement, 'bpmn:StartEvent') && !flowElement.get('eventDefinitions').length;
19
- });
20
-
21
- if (noneStartEvents.length <= 1) {
22
- return;
23
- }
24
-
25
- noneStartEvents.forEach(startEvent => {
26
- reportErrors(startEvent, reporter, {
27
- message: 'Multiple elements of type <bpmn:StartEvent> with no event definition not allowed as children of <bpmn:Process>',
28
- path: null,
29
- data: {
30
- type: ERROR_TYPES.ELEMENT_MULTIPLE_NOT_ALLOWED,
31
- node: startEvent,
32
- parent: null
33
- }
34
- });
35
- });
36
- }
37
-
38
- return {
39
- check
40
- };
41
- });
1
+ const { is } = require('bpmnlint-utils');
2
+
3
+ const { reportErrors } = require('../utils/reporter');
4
+
5
+ const { ERROR_TYPES } = require('../utils/element');
6
+
7
+ const { skipInNonExecutableProcess } = require('../utils/rule');
8
+
9
+ module.exports = skipInNonExecutableProcess(function() {
10
+ function check(node, reporter) {
11
+ if (!is(node, 'bpmn:Process')) {
12
+ return;
13
+ }
14
+
15
+ const flowElements = node.get('flowElements') || [];
16
+
17
+ const noneStartEvents = flowElements.filter(flowElement => {
18
+ return is(flowElement, 'bpmn:StartEvent') && !flowElement.get('eventDefinitions').length;
19
+ });
20
+
21
+ if (noneStartEvents.length <= 1) {
22
+ return;
23
+ }
24
+
25
+ noneStartEvents.forEach(startEvent => {
26
+ reportErrors(startEvent, reporter, {
27
+ message: 'Multiple elements of type <bpmn:StartEvent> with no event definition not allowed as children of <bpmn:Process>',
28
+ path: null,
29
+ data: {
30
+ type: ERROR_TYPES.ELEMENT_MULTIPLE_NOT_ALLOWED,
31
+ node: startEvent,
32
+ parent: null
33
+ }
34
+ });
35
+ });
36
+ }
37
+
38
+ return {
39
+ check
40
+ };
41
+ });
@@ -1,45 +1,45 @@
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:CallActivity')) {
15
- return;
16
- }
17
-
18
- const calledElement = findExtensionElement(node, 'zeebe:CalledElement');
19
-
20
- if (!calledElement) {
21
- return;
22
- }
23
-
24
- const errors = hasProperties(calledElement, {
25
- propagateAllParentVariables: {
26
- allowed: function(value) {
27
-
28
- // `propergateAllParentVariables` is not recognized by Camunda 8.1 and older
29
- // setting it to `true` is therefore allowed for all versions
30
- // setting it to `false` is only allowed for Camunda 8.2 and newer
31
- return value;
32
- },
33
- allowedVersion: '8.2'
34
- }
35
- }, node);
36
-
37
- if (errors && errors.length) {
38
- reportErrors(node, reporter, errors);
39
- }
40
- }
41
-
42
- return {
43
- check
44
- };
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:CallActivity')) {
15
+ return;
16
+ }
17
+
18
+ const calledElement = findExtensionElement(node, 'zeebe:CalledElement');
19
+
20
+ if (!calledElement) {
21
+ return;
22
+ }
23
+
24
+ const errors = hasProperties(calledElement, {
25
+ propagateAllParentVariables: {
26
+ allowed: function(value) {
27
+
28
+ // `propergateAllParentVariables` is not recognized by Camunda 8.1 and older
29
+ // setting it to `true` is therefore allowed for all versions
30
+ // setting it to `false` is only allowed for Camunda 8.2 and newer
31
+ return value;
32
+ },
33
+ allowedVersion: '8.2'
34
+ }
35
+ }, node);
36
+
37
+ if (errors && errors.length) {
38
+ reportErrors(node, reporter, errors);
39
+ }
40
+ }
41
+
42
+ return {
43
+ check
44
+ };
45
45
  });
@@ -1,46 +1,46 @@
1
- const { is } = require('bpmnlint-utils');
2
-
3
- const { reportErrors } = require('../utils/reporter');
4
-
5
- const { getEventDefinition } = require('../utils/element');
6
-
7
- const { ERROR_TYPES } = require('../utils/error-types');
8
-
9
- const { skipInNonExecutableProcess } = require('../utils/rule');
10
-
11
- module.exports = skipInNonExecutableProcess(function() {
12
- function check(node, reporter) {
13
- if (!is(node, 'bpmn:StartEvent')) {
14
- return;
15
- }
16
-
17
- const eventDefinition = getEventDefinition(node);
18
-
19
- if (!eventDefinition || !is(eventDefinition, 'bpmn:SignalEventDefinition')) {
20
- return;
21
- }
22
-
23
- const { $parent: parent } = node;
24
-
25
- if (parent && is(parent, 'bpmn:SubProcess')) {
26
- const error = {
27
- message: 'Element of type <bpmn:StartEvent> with event definition of type <bpmn:SignalEventDefinition> not allowed as child of <bpmn:SubProcess>',
28
- path: null,
29
- data: {
30
- type: ERROR_TYPES.CHILD_ELEMENT_TYPE_NOT_ALLOWED,
31
- node,
32
- parentNode: null,
33
- eventDefinition,
34
- parent,
35
- allowedVersion: '8.3'
36
- }
37
- };
38
-
39
- reportErrors(node, reporter, error);
40
- }
41
- }
42
-
43
- return {
44
- check
45
- };
1
+ const { is } = require('bpmnlint-utils');
2
+
3
+ const { reportErrors } = require('../utils/reporter');
4
+
5
+ const { getEventDefinition } = require('../utils/element');
6
+
7
+ const { ERROR_TYPES } = require('../utils/error-types');
8
+
9
+ const { skipInNonExecutableProcess } = require('../utils/rule');
10
+
11
+ module.exports = skipInNonExecutableProcess(function() {
12
+ function check(node, reporter) {
13
+ if (!is(node, 'bpmn:StartEvent')) {
14
+ return;
15
+ }
16
+
17
+ const eventDefinition = getEventDefinition(node);
18
+
19
+ if (!eventDefinition || !is(eventDefinition, 'bpmn:SignalEventDefinition')) {
20
+ return;
21
+ }
22
+
23
+ const { $parent: parent } = node;
24
+
25
+ if (parent && is(parent, 'bpmn:SubProcess')) {
26
+ const error = {
27
+ message: 'Element of type <bpmn:StartEvent> with event definition of type <bpmn:SignalEventDefinition> not allowed as child of <bpmn:SubProcess>',
28
+ path: null,
29
+ data: {
30
+ type: ERROR_TYPES.CHILD_ELEMENT_TYPE_NOT_ALLOWED,
31
+ node,
32
+ parentNode: null,
33
+ eventDefinition,
34
+ parent,
35
+ allowedVersion: '8.3'
36
+ }
37
+ };
38
+
39
+ reportErrors(node, reporter, error);
40
+ }
41
+ }
42
+
43
+ return {
44
+ check
45
+ };
46
46
  });
@@ -1,19 +1,19 @@
1
- const { hasNoExtensionElement } = require('../utils/element');
2
-
3
- const { reportErrors } = require('../utils/reporter');
4
-
5
- const { skipInNonExecutableProcess } = require('../utils/rule');
6
-
7
- module.exports = skipInNonExecutableProcess(function() {
8
- function check(node, reporter) {
9
- const errors = hasNoExtensionElement(node, 'zeebe:TaskSchedule', node, '8.2');
10
-
11
- if (errors && errors.length) {
12
- reportErrors(node, reporter, errors);
13
- }
14
- }
15
-
16
- return {
17
- check
18
- };
1
+ const { hasNoExtensionElement } = require('../utils/element');
2
+
3
+ const { reportErrors } = require('../utils/reporter');
4
+
5
+ const { skipInNonExecutableProcess } = require('../utils/rule');
6
+
7
+ module.exports = skipInNonExecutableProcess(function() {
8
+ function check(node, reporter) {
9
+ const errors = hasNoExtensionElement(node, 'zeebe:TaskSchedule', node, '8.2');
10
+
11
+ if (errors && errors.length) {
12
+ reportErrors(node, reporter, errors);
13
+ }
14
+ }
15
+
16
+ return {
17
+ check
18
+ };
19
19
  });
@@ -1,24 +1,24 @@
1
- const { hasProperties } = require('../utils/element');
2
-
3
- const { reportErrors } = require('../utils/reporter');
4
-
5
- const { skipInNonExecutableProcess } = require('../utils/rule');
6
-
7
- module.exports = skipInNonExecutableProcess(function() {
8
- function check(node, reporter) {
9
- const errors = hasProperties(node, {
10
- modelerTemplate: {
11
- allowed: false,
12
- allowedVersion: '8.0'
13
- }
14
- }, node);
15
-
16
- if (errors && errors.length) {
17
- reportErrors(node, reporter, errors);
18
- }
19
- }
20
-
21
- return {
22
- check
23
- };
1
+ const { hasProperties } = require('../utils/element');
2
+
3
+ const { reportErrors } = require('../utils/reporter');
4
+
5
+ const { skipInNonExecutableProcess } = require('../utils/rule');
6
+
7
+ module.exports = skipInNonExecutableProcess(function() {
8
+ function check(node, reporter) {
9
+ const errors = hasProperties(node, {
10
+ modelerTemplate: {
11
+ allowed: false,
12
+ allowedVersion: '8.0'
13
+ }
14
+ }, node);
15
+
16
+ if (errors && errors.length) {
17
+ reportErrors(node, reporter, errors);
18
+ }
19
+ }
20
+
21
+ return {
22
+ check
23
+ };
24
24
  });
@@ -1,19 +1,19 @@
1
- const { hasNoExtensionElement } = require('../utils/element');
2
-
3
- const { reportErrors } = require('../utils/reporter');
4
-
5
- const { skipInNonExecutableProcess } = require('../utils/rule');
6
-
7
- module.exports = skipInNonExecutableProcess(function() {
8
- function check(node, reporter) {
9
- const errors = hasNoExtensionElement(node, 'zeebe:Properties', node, '8.1');
10
-
11
- if (errors && errors.length) {
12
- reportErrors(node, reporter, errors);
13
- }
14
- }
15
-
16
- return {
17
- check
18
- };
1
+ const { hasNoExtensionElement } = require('../utils/element');
2
+
3
+ const { reportErrors } = require('../utils/reporter');
4
+
5
+ const { skipInNonExecutableProcess } = require('../utils/rule');
6
+
7
+ module.exports = skipInNonExecutableProcess(function() {
8
+ function check(node, reporter) {
9
+ const errors = hasNoExtensionElement(node, 'zeebe:Properties', node, '8.1');
10
+
11
+ if (errors && errors.length) {
12
+ reportErrors(node, reporter, errors);
13
+ }
14
+ }
15
+
16
+ return {
17
+ check
18
+ };
19
19
  });
@@ -1,27 +1,27 @@
1
- const { is } = require('bpmnlint-utils');
2
-
3
- const { reportErrors } = require('../utils/reporter');
4
-
5
- const { skipInNonExecutableProcess } = require('../utils/rule');
6
-
7
- const { hasNoExtensionElement } = require('../utils/element');
8
-
9
- const ALLOWED_VERSION = '8.5';
10
-
11
- module.exports = skipInNonExecutableProcess(function() {
12
- function check(node, reporter) {
13
- if (!is(node, 'bpmn:UserTask')) {
14
- return;
15
- }
16
-
17
- const errors = hasNoExtensionElement(node, 'zeebe:UserTask', node, ALLOWED_VERSION);
18
-
19
- if (errors && errors.length) {
20
- reportErrors(node, reporter, errors);
21
- }
22
- }
23
-
24
- return {
25
- check
26
- };
27
- });
1
+ const { is } = require('bpmnlint-utils');
2
+
3
+ const { reportErrors } = require('../utils/reporter');
4
+
5
+ const { skipInNonExecutableProcess } = require('../utils/rule');
6
+
7
+ const { hasNoExtensionElement } = require('../utils/element');
8
+
9
+ const ALLOWED_VERSION = '8.5';
10
+
11
+ module.exports = skipInNonExecutableProcess(function() {
12
+ function check(node, reporter) {
13
+ if (!is(node, 'bpmn:UserTask')) {
14
+ return;
15
+ }
16
+
17
+ const errors = hasNoExtensionElement(node, 'zeebe:UserTask', node, ALLOWED_VERSION);
18
+
19
+ if (errors && errors.length) {
20
+ reportErrors(node, reporter, errors);
21
+ }
22
+ }
23
+
24
+ return {
25
+ check
26
+ };
27
+ });