bpmnlint-plugin-camunda-compat 2.2.0 → 2.4.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.
- package/index.js +7 -1
- package/package.json +1 -1
- package/rules/camunda-cloud/collapsed-subprocess.js +1 -1
- package/rules/camunda-cloud/escalation-boundary-event-attached-to-ref.js +48 -0
- package/rules/camunda-cloud/escalation-reference.js +21 -9
- package/rules/camunda-cloud/start-form.js +29 -0
- package/rules/utils/error-types.js +1 -0
package/index.js
CHANGED
|
@@ -18,6 +18,7 @@ const camundaCloud10Rules = withConfig({
|
|
|
18
18
|
'no-template': 'error',
|
|
19
19
|
'no-zeebe-properties': 'error',
|
|
20
20
|
'sequence-flow-condition': 'error',
|
|
21
|
+
'start-form': 'error',
|
|
21
22
|
'subscription': 'error',
|
|
22
23
|
'timer': 'error',
|
|
23
24
|
'user-task-form': 'error',
|
|
@@ -44,13 +45,16 @@ const camundaCloud82Rules = withConfig({
|
|
|
44
45
|
'no-candidate-users',
|
|
45
46
|
'no-task-schedule'
|
|
46
47
|
]),
|
|
48
|
+
'escalation-boundary-event-attached-to-ref': 'error',
|
|
47
49
|
'escalation-reference': 'error',
|
|
48
50
|
'no-signal-event-sub-process': 'error',
|
|
49
51
|
'task-schedule': 'error'
|
|
50
52
|
}, { version: '8.2' });
|
|
51
53
|
|
|
52
54
|
const camundaCloud83Rules = withConfig({
|
|
53
|
-
...omit(camundaCloud82Rules,
|
|
55
|
+
...omit(camundaCloud82Rules, [
|
|
56
|
+
'start-form'
|
|
57
|
+
]),
|
|
54
58
|
'signal-reference': 'error'
|
|
55
59
|
}, { version: '8.3' });
|
|
56
60
|
|
|
@@ -72,6 +76,7 @@ const rules = {
|
|
|
72
76
|
'collapsed-subprocess': './rules/camunda-cloud/collapsed-subprocess',
|
|
73
77
|
'duplicate-task-headers': './rules/camunda-cloud/duplicate-task-headers',
|
|
74
78
|
'error-reference': './rules/camunda-cloud/error-reference',
|
|
79
|
+
'escalation-boundary-event-attached-to-ref': './rules/camunda-cloud/escalation-boundary-event-attached-to-ref',
|
|
75
80
|
'escalation-reference': './rules/camunda-cloud/escalation-reference',
|
|
76
81
|
'event-based-gateway-target': './rules/camunda-cloud/event-based-gateway-target',
|
|
77
82
|
'executable-process': './rules/camunda-cloud/executable-process',
|
|
@@ -90,6 +95,7 @@ const rules = {
|
|
|
90
95
|
'no-zeebe-properties': './rules/camunda-cloud/no-zeebe-properties',
|
|
91
96
|
'sequence-flow-condition': './rules/camunda-cloud/sequence-flow-condition',
|
|
92
97
|
'signal-reference': './rules/camunda-cloud/signal-reference',
|
|
98
|
+
'start-form': './rules/camunda-cloud/start-form',
|
|
93
99
|
'subscription': './rules/camunda-cloud/subscription',
|
|
94
100
|
'task-schedule': './rules/camunda-cloud/task-schedule',
|
|
95
101
|
'timer': './rules/camunda-cloud/timer',
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@ module.exports = skipInNonExecutableProcess(function() {
|
|
|
16
16
|
const node = di.bpmnElement;
|
|
17
17
|
|
|
18
18
|
const error = {
|
|
19
|
-
message: `A <${ node.$type }> must be expanded
|
|
19
|
+
message: `A <${ node.$type }> must be expanded`,
|
|
20
20
|
data: {
|
|
21
21
|
type: ERROR_TYPES.ELEMENT_COLLAPSED_NOT_ALLOWED,
|
|
22
22
|
node: node,
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const {
|
|
2
|
+
is,
|
|
3
|
+
isAny
|
|
4
|
+
} = require('bpmnlint-utils');
|
|
5
|
+
|
|
6
|
+
const {
|
|
7
|
+
getEventDefinition,
|
|
8
|
+
isAnyExactly
|
|
9
|
+
} = require('../utils/element');
|
|
10
|
+
|
|
11
|
+
const { ERROR_TYPES } = require('../utils/error-types');
|
|
12
|
+
|
|
13
|
+
const { reportErrors } = require('../utils/reporter');
|
|
14
|
+
|
|
15
|
+
const { skipInNonExecutableProcess } = require('../utils/rule');
|
|
16
|
+
|
|
17
|
+
module.exports = skipInNonExecutableProcess(function() {
|
|
18
|
+
function check(node, reporter) {
|
|
19
|
+
if (!isAny(node, [ 'bpmn:CatchEvent', 'bpmn:ThrowEvent' ])) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const eventDefinition = getEventDefinition(node);
|
|
24
|
+
|
|
25
|
+
if (!eventDefinition || !is(eventDefinition, 'bpmn:EscalationEventDefinition')) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const attachedToRef = node.get('attachedToRef');
|
|
30
|
+
|
|
31
|
+
if (attachedToRef && !isAnyExactly(attachedToRef, [ 'bpmn:CallActivity', 'bpmn:SubProcess' ])) {
|
|
32
|
+
reportErrors(node, reporter, {
|
|
33
|
+
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 }>`,
|
|
34
|
+
path: null,
|
|
35
|
+
data: {
|
|
36
|
+
type: ERROR_TYPES.ATTACHED_TO_REF_ELEMENT_TYPE_NOT_ALLOWED,
|
|
37
|
+
node,
|
|
38
|
+
parentNode: null,
|
|
39
|
+
attachedToRef
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return {
|
|
46
|
+
check
|
|
47
|
+
};
|
|
48
|
+
});
|
|
@@ -24,27 +24,35 @@ module.exports = skipInNonExecutableProcess(function() {
|
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
let errors =
|
|
28
|
-
escalationRef: {
|
|
29
|
-
required: true
|
|
30
|
-
}
|
|
31
|
-
}, node);
|
|
27
|
+
let errors = [];
|
|
32
28
|
|
|
33
|
-
if (
|
|
34
|
-
|
|
29
|
+
if (!isNoEscalationRefAllowed(node)) {
|
|
30
|
+
errors = hasProperties(eventDefinition, {
|
|
31
|
+
escalationRef: {
|
|
32
|
+
required: true
|
|
33
|
+
}
|
|
34
|
+
}, node);
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
if (errors.length) {
|
|
37
|
+
reportErrors(node, reporter, errors);
|
|
38
|
+
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
37
41
|
}
|
|
38
42
|
|
|
39
43
|
const escalationRef = eventDefinition.get('escalationRef');
|
|
40
44
|
|
|
45
|
+
if (!escalationRef) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
41
49
|
errors = hasProperties(escalationRef, {
|
|
42
50
|
escalationCode: {
|
|
43
51
|
required: true
|
|
44
52
|
}
|
|
45
53
|
}, node);
|
|
46
54
|
|
|
47
|
-
if (errors
|
|
55
|
+
if (errors.length) {
|
|
48
56
|
reportErrors(node, reporter, errors);
|
|
49
57
|
}
|
|
50
58
|
}
|
|
@@ -53,3 +61,7 @@ module.exports = skipInNonExecutableProcess(function() {
|
|
|
53
61
|
check
|
|
54
62
|
};
|
|
55
63
|
});
|
|
64
|
+
|
|
65
|
+
function isNoEscalationRefAllowed(node, version) {
|
|
66
|
+
return is(node, 'bpmn:BoundaryEvent');
|
|
67
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const { is } = require('bpmnlint-utils');
|
|
2
|
+
|
|
3
|
+
const { hasNoExtensionElement } = require('../utils/element');
|
|
4
|
+
|
|
5
|
+
const { reportErrors } = require('../utils/reporter');
|
|
6
|
+
|
|
7
|
+
const { skipInNonExecutableProcess } = require('../utils/rule');
|
|
8
|
+
|
|
9
|
+
const { greaterOrEqual } = require('../utils/version');
|
|
10
|
+
|
|
11
|
+
const startFormAllowedVersion = '8.3';
|
|
12
|
+
|
|
13
|
+
module.exports = skipInNonExecutableProcess(function({ version }) {
|
|
14
|
+
function check(node, reporter) {
|
|
15
|
+
if (!is(node, 'bpmn:StartEvent') || greaterOrEqual(version, startFormAllowedVersion)) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let errors = hasNoExtensionElement(node, 'zeebe:FormDefinition', node, startFormAllowedVersion);
|
|
20
|
+
|
|
21
|
+
if (errors.length) {
|
|
22
|
+
reportErrors(node, reporter, errors);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return {
|
|
27
|
+
check
|
|
28
|
+
};
|
|
29
|
+
});
|
|
@@ -10,6 +10,7 @@ module.exports.ERROR_TYPES = Object.freeze({
|
|
|
10
10
|
EXTENSION_ELEMENT_NOT_ALLOWED: 'camunda.extensionElementNotAllowed',
|
|
11
11
|
EXTENSION_ELEMENT_REQUIRED: 'camunda.extensionElementRequired',
|
|
12
12
|
FEEL_EXPRESSION_INVALID: 'camunda.feelExpressionInvalid',
|
|
13
|
+
ATTACHED_TO_REF_ELEMENT_TYPE_NOT_ALLOWED: 'camunda.attachedToRefElementTypeNotAllowed',
|
|
13
14
|
PROPERTY_DEPENDENT_REQUIRED: 'camunda.propertyDependentRequired',
|
|
14
15
|
PROPERTY_NOT_ALLOWED: 'camunda.propertyNotAllowed',
|
|
15
16
|
PROPERTY_REQUIRED: 'camunda.propertyRequired',
|