bpmnlint-plugin-camunda-compat 2.35.0 → 2.36.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 (64) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +39 -39
  3. package/index.js +286 -286
  4. package/package.json +53 -53
  5. package/rules/camunda-cloud/ad-hoc-sub-process.js +60 -60
  6. package/rules/camunda-cloud/called-element.js +44 -44
  7. package/rules/camunda-cloud/collapsed-subprocess.js +40 -40
  8. package/rules/camunda-cloud/connector-properties/config.js +90 -90
  9. package/rules/camunda-cloud/connector-properties/index.js +47 -47
  10. package/rules/camunda-cloud/duplicate-execution-listeners.js +33 -33
  11. package/rules/camunda-cloud/duplicate-task-headers.js +58 -58
  12. package/rules/camunda-cloud/element-type/config.js +67 -67
  13. package/rules/camunda-cloud/element-type/index.js +135 -135
  14. package/rules/camunda-cloud/error-reference.js +72 -72
  15. package/rules/camunda-cloud/escalation-boundary-event-attached-to-ref.js +47 -47
  16. package/rules/camunda-cloud/escalation-reference.js +67 -67
  17. package/rules/camunda-cloud/event-based-gateway-target.js +38 -38
  18. package/rules/camunda-cloud/executable-process.js +61 -61
  19. package/rules/camunda-cloud/execution-listener.js +33 -33
  20. package/rules/camunda-cloud/feel.js +86 -86
  21. package/rules/camunda-cloud/implementation/config.js +19 -19
  22. package/rules/camunda-cloud/implementation/index.js +218 -218
  23. package/rules/camunda-cloud/inclusive-gateway.js +35 -35
  24. package/rules/camunda-cloud/link-event.js +142 -142
  25. package/rules/camunda-cloud/loop-characteristics.js +66 -66
  26. package/rules/camunda-cloud/message-reference.js +61 -61
  27. package/rules/camunda-cloud/no-binding-type.js +43 -43
  28. package/rules/camunda-cloud/no-candidate-users.js +38 -38
  29. package/rules/camunda-cloud/no-execution-listeners.js +21 -21
  30. package/rules/camunda-cloud/no-expression.js +173 -173
  31. package/rules/camunda-cloud/no-loop.js +316 -316
  32. package/rules/camunda-cloud/no-multiple-none-start-events.js +41 -41
  33. package/rules/camunda-cloud/no-priority-definition.js +18 -18
  34. package/rules/camunda-cloud/no-propagate-all-parent-variables.js +44 -44
  35. package/rules/camunda-cloud/no-signal-event-sub-process.js +45 -45
  36. package/rules/camunda-cloud/no-task-listeners.js +21 -21
  37. package/rules/camunda-cloud/no-task-schedule.js +18 -18
  38. package/rules/camunda-cloud/no-template.js +23 -23
  39. package/rules/camunda-cloud/no-version-tag.js +24 -24
  40. package/rules/camunda-cloud/no-zeebe-properties.js +18 -18
  41. package/rules/camunda-cloud/no-zeebe-user-task.js +27 -27
  42. package/rules/camunda-cloud/priority-definition.js +61 -61
  43. package/rules/camunda-cloud/secrets.js +119 -119
  44. package/rules/camunda-cloud/sequence-flow-condition.js +56 -56
  45. package/rules/camunda-cloud/signal-reference.js +64 -64
  46. package/rules/camunda-cloud/start-event-form.js +97 -97
  47. package/rules/camunda-cloud/subscription.js +65 -65
  48. package/rules/camunda-cloud/task-listener.js +39 -39
  49. package/rules/camunda-cloud/task-schedule.js +67 -67
  50. package/rules/camunda-cloud/timer/config.js +46 -46
  51. package/rules/camunda-cloud/timer/index.js +183 -183
  52. package/rules/camunda-cloud/user-task-definition.js +24 -24
  53. package/rules/camunda-cloud/user-task-form.js +142 -142
  54. package/rules/camunda-cloud/wait-for-completion.js +46 -46
  55. package/rules/camunda-cloud/zeebe-user-task.js +30 -30
  56. package/rules/camunda-platform/history-time-to-live.js +24 -21
  57. package/rules/helper.js +38 -38
  58. package/rules/utils/cron.js +95 -95
  59. package/rules/utils/element.js +533 -533
  60. package/rules/utils/error-types.js +26 -26
  61. package/rules/utils/iso8601.js +52 -52
  62. package/rules/utils/reporter.js +37 -37
  63. package/rules/utils/rule.js +46 -46
  64. package/rules/utils/version.js +4 -4
@@ -1,73 +1,73 @@
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
- const { greaterOrEqual } = require('../utils/version');
16
- const { annotateRule } = require('../helper');
17
-
18
- const NO_ERROR_REF_ALLOWED_VERSION = '8.2';
19
-
20
- module.exports = skipInNonExecutableProcess(function({ version }) {
21
- function check(node, reporter) {
22
- if (!isAny(node, [ 'bpmn:CatchEvent', 'bpmn:ThrowEvent' ])) {
23
- return;
24
- }
25
-
26
- const eventDefinition = getEventDefinition(node);
27
-
28
- if (!eventDefinition || !is(eventDefinition, 'bpmn:ErrorEventDefinition')) {
29
- return;
30
- }
31
-
32
- let errors = [];
33
-
34
- if (!isNoErrorRefAllowed(node, version)) {
35
- errors = hasProperties(eventDefinition, {
36
- errorRef: {
37
- required: true,
38
- allowedVersion: '8.2'
39
- }
40
- }, node);
41
-
42
- if (errors.length) {
43
- reportErrors(node, reporter, errors);
44
-
45
- return;
46
- }
47
- }
48
-
49
- const errorRef = eventDefinition.get('errorRef');
50
-
51
- if (!errorRef) {
52
- return;
53
- }
54
-
55
- errors = hasProperties(errorRef, {
56
- errorCode: {
57
- required: true
58
- }
59
- }, node);
60
-
61
- if (errors.length) {
62
- reportErrors(node, reporter, errors);
63
- }
64
- }
65
-
66
- return annotateRule('error-reference', {
67
- check
68
- });
69
- });
70
-
71
- function isNoErrorRefAllowed(node, version) {
72
- return is(node, 'bpmn:CatchEvent') && greaterOrEqual(version, NO_ERROR_REF_ALLOWED_VERSION);
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
+ const { greaterOrEqual } = require('../utils/version');
16
+ const { annotateRule } = require('../helper');
17
+
18
+ const NO_ERROR_REF_ALLOWED_VERSION = '8.2';
19
+
20
+ module.exports = skipInNonExecutableProcess(function({ version }) {
21
+ function check(node, reporter) {
22
+ if (!isAny(node, [ 'bpmn:CatchEvent', 'bpmn:ThrowEvent' ])) {
23
+ return;
24
+ }
25
+
26
+ const eventDefinition = getEventDefinition(node);
27
+
28
+ if (!eventDefinition || !is(eventDefinition, 'bpmn:ErrorEventDefinition')) {
29
+ return;
30
+ }
31
+
32
+ let errors = [];
33
+
34
+ if (!isNoErrorRefAllowed(node, version)) {
35
+ errors = hasProperties(eventDefinition, {
36
+ errorRef: {
37
+ required: true,
38
+ allowedVersion: '8.2'
39
+ }
40
+ }, node);
41
+
42
+ if (errors.length) {
43
+ reportErrors(node, reporter, errors);
44
+
45
+ return;
46
+ }
47
+ }
48
+
49
+ const errorRef = eventDefinition.get('errorRef');
50
+
51
+ if (!errorRef) {
52
+ return;
53
+ }
54
+
55
+ errors = hasProperties(errorRef, {
56
+ errorCode: {
57
+ required: true
58
+ }
59
+ }, node);
60
+
61
+ if (errors.length) {
62
+ reportErrors(node, reporter, errors);
63
+ }
64
+ }
65
+
66
+ return annotateRule('error-reference', {
67
+ check
68
+ });
69
+ });
70
+
71
+ function isNoErrorRefAllowed(node, version) {
72
+ return is(node, 'bpmn:CatchEvent') && greaterOrEqual(version, NO_ERROR_REF_ALLOWED_VERSION);
73
73
  }
@@ -1,47 +1,47 @@
1
- const {
2
- is,
3
- isAny
4
- } = require('bpmnlint-utils');
5
-
6
- const {
7
- getEventDefinition,
8
- } = require('../utils/element');
9
-
10
- const { ERROR_TYPES } = require('../utils/error-types');
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 (!isAny(node, [ 'bpmn:CatchEvent', 'bpmn:ThrowEvent' ])) {
19
- return;
20
- }
21
-
22
- const eventDefinition = getEventDefinition(node);
23
-
24
- if (!eventDefinition || !is(eventDefinition, 'bpmn:EscalationEventDefinition')) {
25
- return;
26
- }
27
-
28
- const attachedToRef = node.get('attachedToRef');
29
-
30
- if (attachedToRef && is(attachedToRef, 'bpmn:Task')) {
31
- reportErrors(node, reporter, {
32
- message: `Element of type <bpmn:BoundaryEvent> with event definition of type <bpmn:EscalationEventDefinition> is not allowed to be attached to element of type <${ attachedToRef.$type }>`,
33
- path: null,
34
- data: {
35
- type: ERROR_TYPES.ATTACHED_TO_REF_ELEMENT_TYPE_NOT_ALLOWED,
36
- node,
37
- parentNode: null,
38
- attachedToRef
39
- }
40
- });
41
- }
42
- }
43
-
44
- return {
45
- check
46
- };
47
- });
1
+ const {
2
+ is,
3
+ isAny
4
+ } = require('bpmnlint-utils');
5
+
6
+ const {
7
+ getEventDefinition,
8
+ } = require('../utils/element');
9
+
10
+ const { ERROR_TYPES } = require('../utils/error-types');
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 (!isAny(node, [ 'bpmn:CatchEvent', 'bpmn:ThrowEvent' ])) {
19
+ return;
20
+ }
21
+
22
+ const eventDefinition = getEventDefinition(node);
23
+
24
+ if (!eventDefinition || !is(eventDefinition, 'bpmn:EscalationEventDefinition')) {
25
+ return;
26
+ }
27
+
28
+ const attachedToRef = node.get('attachedToRef');
29
+
30
+ if (attachedToRef && is(attachedToRef, 'bpmn:Task')) {
31
+ reportErrors(node, reporter, {
32
+ message: `Element of type <bpmn:BoundaryEvent> with event definition of type <bpmn:EscalationEventDefinition> is not allowed to be attached to element of type <${ attachedToRef.$type }>`,
33
+ path: null,
34
+ data: {
35
+ type: ERROR_TYPES.ATTACHED_TO_REF_ELEMENT_TYPE_NOT_ALLOWED,
36
+ node,
37
+ parentNode: null,
38
+ attachedToRef
39
+ }
40
+ });
41
+ }
42
+ }
43
+
44
+ return {
45
+ check
46
+ };
47
+ });
@@ -1,68 +1,68 @@
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
- const { annotateRule } = require('../helper');
15
-
16
- module.exports = skipInNonExecutableProcess(function() {
17
- function check(node, reporter) {
18
- if (!isAny(node, [ 'bpmn:CatchEvent', 'bpmn:ThrowEvent' ])) {
19
- return;
20
- }
21
-
22
- const eventDefinition = getEventDefinition(node);
23
-
24
- if (!eventDefinition || !is(eventDefinition, 'bpmn:EscalationEventDefinition')) {
25
- return;
26
- }
27
-
28
- let errors = [];
29
-
30
- if (!isNoEscalationRefAllowed(node)) {
31
- errors = hasProperties(eventDefinition, {
32
- escalationRef: {
33
- required: true
34
- }
35
- }, node);
36
-
37
- if (errors.length) {
38
- reportErrors(node, reporter, errors);
39
-
40
- return;
41
- }
42
- }
43
-
44
- const escalationRef = eventDefinition.get('escalationRef');
45
-
46
- if (!escalationRef) {
47
- return;
48
- }
49
-
50
- errors = hasProperties(escalationRef, {
51
- escalationCode: {
52
- required: true
53
- }
54
- }, node);
55
-
56
- if (errors.length) {
57
- reportErrors(node, reporter, errors);
58
- }
59
- }
60
-
61
- return annotateRule('escalation-reference', {
62
- check
63
- });
64
- });
65
-
66
- function isNoEscalationRefAllowed(node) {
67
- return isAny(node, [ 'bpmn:CatchEvent', 'bpmn:BoundaryEvent' ]);
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
+ const { annotateRule } = require('../helper');
15
+
16
+ module.exports = skipInNonExecutableProcess(function() {
17
+ function check(node, reporter) {
18
+ if (!isAny(node, [ 'bpmn:CatchEvent', 'bpmn:ThrowEvent' ])) {
19
+ return;
20
+ }
21
+
22
+ const eventDefinition = getEventDefinition(node);
23
+
24
+ if (!eventDefinition || !is(eventDefinition, 'bpmn:EscalationEventDefinition')) {
25
+ return;
26
+ }
27
+
28
+ let errors = [];
29
+
30
+ if (!isNoEscalationRefAllowed(node)) {
31
+ errors = hasProperties(eventDefinition, {
32
+ escalationRef: {
33
+ required: true
34
+ }
35
+ }, node);
36
+
37
+ if (errors.length) {
38
+ reportErrors(node, reporter, errors);
39
+
40
+ return;
41
+ }
42
+ }
43
+
44
+ const escalationRef = eventDefinition.get('escalationRef');
45
+
46
+ if (!escalationRef) {
47
+ return;
48
+ }
49
+
50
+ errors = hasProperties(escalationRef, {
51
+ escalationCode: {
52
+ required: true
53
+ }
54
+ }, node);
55
+
56
+ if (errors.length) {
57
+ reportErrors(node, reporter, errors);
58
+ }
59
+ }
60
+
61
+ return annotateRule('escalation-reference', {
62
+ check
63
+ });
64
+ });
65
+
66
+ function isNoEscalationRefAllowed(node) {
67
+ return isAny(node, [ 'bpmn:CatchEvent', 'bpmn:BoundaryEvent' ]);
68
68
  }
@@ -1,39 +1,39 @@
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(node, reporter) {
11
- if (!is(node, 'bpmn:ReceiveTask')) {
12
- return;
13
- }
14
-
15
- // receive task as event-based gateway target is allowed by BPMN 2.0 but not
16
- // supported by Zeebe
17
- const error = node.get('incoming').some((sequenceFlow) => {
18
- const source = sequenceFlow.get('sourceRef');
19
-
20
- return is(source, 'bpmn:EventBasedGateway');
21
- });
22
-
23
- if (error) {
24
- reportErrors(node, reporter, {
25
- message: 'Element of type <bpmn:ReceiveTask> not allowed as event-based gateway target',
26
- path: null,
27
- data: {
28
- type: ERROR_TYPES.EVENT_BASED_GATEWAY_TARGET_NOT_ALLOWED,
29
- node,
30
- parentNode: null
31
- }
32
- });
33
- }
34
- }
35
-
36
- return {
37
- check
38
- };
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(node, reporter) {
11
+ if (!is(node, 'bpmn:ReceiveTask')) {
12
+ return;
13
+ }
14
+
15
+ // receive task as event-based gateway target is allowed by BPMN 2.0 but not
16
+ // supported by Zeebe
17
+ const error = node.get('incoming').some((sequenceFlow) => {
18
+ const source = sequenceFlow.get('sourceRef');
19
+
20
+ return is(source, 'bpmn:EventBasedGateway');
21
+ });
22
+
23
+ if (error) {
24
+ reportErrors(node, reporter, {
25
+ message: 'Element of type <bpmn:ReceiveTask> not allowed as event-based gateway target',
26
+ path: null,
27
+ data: {
28
+ type: ERROR_TYPES.EVENT_BASED_GATEWAY_TARGET_NOT_ALLOWED,
29
+ node,
30
+ parentNode: null
31
+ }
32
+ });
33
+ }
34
+ }
35
+
36
+ return {
37
+ check
38
+ };
39
39
  });
@@ -1,62 +1,62 @@
1
- const { is } = require('bpmnlint-utils');
2
-
3
- const { hasProperties } = require('../utils/element');
4
-
5
- const { reportErrors } = require('../utils/reporter');
6
-
7
- module.exports = function() {
8
- function check(node, reporter) {
9
- if (!is(node, 'bpmn:Definitions')) {
10
- return;
11
- }
12
-
13
- const rootElements = node.get('rootElements'),
14
- collaboration = rootElements.find(rootElement => is(rootElement, 'bpmn:Collaboration')),
15
- processes = rootElements.filter(rootElement => is(rootElement, 'bpmn:Process'));
16
-
17
- let errors = [];
18
-
19
- for (const process of processes) {
20
- const parentNode = getParentNode(process, collaboration);
21
-
22
- errors = [
23
- ...errors,
24
- ...hasProperties(process, {
25
- isExecutable: {
26
- value: true
27
- }
28
- }, parentNode)
29
- ];
30
- }
31
-
32
- if (errors.length > processes.length - 1) {
33
- errors.forEach(error => {
34
- const { data } = error;
35
-
36
- const { node: process } = data;
37
-
38
- reportErrors(getParentNode(process, collaboration), reporter, error);
39
- });
40
- }
41
- }
42
-
43
- return {
44
- check
45
- };
46
- };
47
-
48
- function getParentNode(process, collaboration) {
49
- if (!collaboration) {
50
- return process;
51
- }
52
-
53
- const participants = collaboration.get('participants');
54
-
55
- const participant = participants.find(participant => participant.get('processRef') === process);
56
-
57
- if (participant) {
58
- return participant;
59
- }
60
-
61
- return process;
1
+ const { is } = require('bpmnlint-utils');
2
+
3
+ const { hasProperties } = require('../utils/element');
4
+
5
+ const { reportErrors } = require('../utils/reporter');
6
+
7
+ module.exports = function() {
8
+ function check(node, reporter) {
9
+ if (!is(node, 'bpmn:Definitions')) {
10
+ return;
11
+ }
12
+
13
+ const rootElements = node.get('rootElements'),
14
+ collaboration = rootElements.find(rootElement => is(rootElement, 'bpmn:Collaboration')),
15
+ processes = rootElements.filter(rootElement => is(rootElement, 'bpmn:Process'));
16
+
17
+ let errors = [];
18
+
19
+ for (const process of processes) {
20
+ const parentNode = getParentNode(process, collaboration);
21
+
22
+ errors = [
23
+ ...errors,
24
+ ...hasProperties(process, {
25
+ isExecutable: {
26
+ value: true
27
+ }
28
+ }, parentNode)
29
+ ];
30
+ }
31
+
32
+ if (errors.length > processes.length - 1) {
33
+ errors.forEach(error => {
34
+ const { data } = error;
35
+
36
+ const { node: process } = data;
37
+
38
+ reportErrors(getParentNode(process, collaboration), reporter, error);
39
+ });
40
+ }
41
+ }
42
+
43
+ return {
44
+ check
45
+ };
46
+ };
47
+
48
+ function getParentNode(process, collaboration) {
49
+ if (!collaboration) {
50
+ return process;
51
+ }
52
+
53
+ const participants = collaboration.get('participants');
54
+
55
+ const participant = participants.find(participant => participant.get('processRef') === process);
56
+
57
+ if (participant) {
58
+ return participant;
59
+ }
60
+
61
+ return process;
62
62
  }
@@ -1,33 +1,33 @@
1
- const {
2
- findExtensionElement,
3
- hasProperties
4
- } = require('../utils/element');
5
-
6
- const { reportErrors } = require('../utils/reporter');
7
-
8
- const { skipInNonExecutableProcess } = require('../utils/rule');
9
-
10
- module.exports = skipInNonExecutableProcess(function() {
11
- function check(node, reporter) {
12
- const executionListeners = findExtensionElement(node, 'zeebe:ExecutionListeners');
13
-
14
- if (!executionListeners) {
15
- return;
16
- }
17
-
18
- const listeners = executionListeners.get('listeners');
19
- const errors = listeners.flatMap(listener => hasProperties(listener, {
20
- type: {
21
- required: true
22
- }
23
- }, node));
24
-
25
- if (errors.length) {
26
- reportErrors(node, reporter, errors);
27
- }
28
- }
29
-
30
- return {
31
- check
32
- };
33
- });
1
+ const {
2
+ findExtensionElement,
3
+ hasProperties
4
+ } = require('../utils/element');
5
+
6
+ const { reportErrors } = require('../utils/reporter');
7
+
8
+ const { skipInNonExecutableProcess } = require('../utils/rule');
9
+
10
+ module.exports = skipInNonExecutableProcess(function() {
11
+ function check(node, reporter) {
12
+ const executionListeners = findExtensionElement(node, 'zeebe:ExecutionListeners');
13
+
14
+ if (!executionListeners) {
15
+ return;
16
+ }
17
+
18
+ const listeners = executionListeners.get('listeners');
19
+ const errors = listeners.flatMap(listener => hasProperties(listener, {
20
+ type: {
21
+ required: true
22
+ }
23
+ }, node));
24
+
25
+ if (errors.length) {
26
+ reportErrors(node, reporter, errors);
27
+ }
28
+ }
29
+
30
+ return {
31
+ check
32
+ };
33
+ });