bpmnlint-plugin-camunda-compat 0.20.0 → 0.22.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 +29 -49
- package/package.json +1 -1
- package/rules/called-element.js +4 -2
- package/rules/collapsed-subprocess.js +5 -4
- package/rules/duplicate-task-headers.js +4 -2
- package/rules/element-type/index.js +4 -2
- package/rules/error-reference.js +14 -4
- package/rules/escalation-reference.js +4 -2
- package/rules/feel.js +4 -2
- package/rules/implementation/index.js +4 -2
- package/rules/inclusive-gateway.js +4 -2
- package/rules/loop-characteristics.js +4 -2
- package/rules/message-reference.js +4 -2
- package/rules/no-candidate-users.js +4 -2
- package/rules/no-expression.js +3 -1
- package/rules/no-template.js +4 -2
- package/rules/no-zeebe-properties.js +4 -2
- package/rules/sequence-flow-condition.js +4 -2
- package/rules/subscription.js +4 -2
- package/rules/timer/index.js +4 -2
- package/rules/user-task-form.js +4 -2
- package/rules/utils/element.js +31 -23
- package/rules/utils/rule.js +43 -0
package/index.js
CHANGED
@@ -1,75 +1,45 @@
|
|
1
1
|
const { omit } = require('min-dash');
|
2
2
|
|
3
|
-
const camundaCloud10Rules = {
|
4
|
-
'implementation':
|
3
|
+
const camundaCloud10Rules = withConfig({
|
4
|
+
'implementation': 'error',
|
5
5
|
'called-element': 'error',
|
6
6
|
'collapsed-subprocess': 'error',
|
7
7
|
'duplicate-task-headers': 'error',
|
8
|
-
'element-type':
|
8
|
+
'element-type': 'error',
|
9
9
|
'error-reference': 'error',
|
10
10
|
'executable-process': 'error',
|
11
11
|
'loop-characteristics': 'error',
|
12
12
|
'message-reference': 'error',
|
13
13
|
'no-candidate-users': 'error',
|
14
|
-
'no-expression':
|
14
|
+
'no-expression': 'error',
|
15
15
|
'no-template': 'error',
|
16
16
|
'no-zeebe-properties': 'error',
|
17
17
|
'sequence-flow-condition': 'error',
|
18
18
|
'subscription': 'error',
|
19
|
-
'timer':
|
19
|
+
'timer': 'error',
|
20
20
|
'user-task-form': 'error',
|
21
21
|
'feel': 'error'
|
22
|
-
};
|
22
|
+
}, { version: '1.0' });
|
23
23
|
|
24
|
-
const camundaCloud11Rules = {
|
25
|
-
...camundaCloud10Rules,
|
26
|
-
'implementation': [ 'error', { version: '1.1' } ],
|
27
|
-
'element-type': [ 'error', { version: '1.1' } ],
|
28
|
-
'no-expression': [ 'error', { version: '1.1' } ],
|
29
|
-
'timer': [ 'error', { version: '1.1' } ]
|
30
|
-
};
|
24
|
+
const camundaCloud11Rules = withConfig(camundaCloud10Rules, { version: '1.1' });
|
31
25
|
|
32
|
-
const camundaCloud12Rules = {
|
33
|
-
...camundaCloud11Rules,
|
34
|
-
'implementation': [ 'error', { version: '1.2' } ],
|
35
|
-
'element-type': [ 'error', { version: '1.2' } ],
|
36
|
-
'no-expression': [ 'error', { version: '1.2' } ],
|
37
|
-
'timer': [ 'error', { version: '1.2' } ]
|
38
|
-
};
|
26
|
+
const camundaCloud12Rules = withConfig(camundaCloud11Rules, { version: '1.2' });
|
39
27
|
|
40
|
-
const camundaCloud13Rules = {
|
41
|
-
...camundaCloud12Rules,
|
42
|
-
'implementation': [ 'error', { version: '1.3' } ],
|
43
|
-
'element-type': [ 'error', { version: '1.3' } ],
|
44
|
-
'no-expression': [ 'error', { version: '1.3' } ],
|
45
|
-
'timer': [ 'error', { version: '1.3' } ]
|
46
|
-
};
|
28
|
+
const camundaCloud13Rules = withConfig(camundaCloud12Rules, { version: '1.3' });
|
47
29
|
|
48
|
-
const camundaCloud80Rules = {
|
49
|
-
...omit(camundaCloud13Rules, 'no-template')
|
50
|
-
|
51
|
-
'element-type': [ 'error', { version: '8.0' } ],
|
52
|
-
'no-expression': [ 'error', { version: '8.0' } ],
|
53
|
-
'timer': [ 'error', { version: '8.0' } ]
|
54
|
-
};
|
30
|
+
const camundaCloud80Rules = withConfig({
|
31
|
+
...omit(camundaCloud13Rules, 'no-template')
|
32
|
+
}, { version: '8.0' });
|
55
33
|
|
56
|
-
const camundaCloud81Rules = {
|
34
|
+
const camundaCloud81Rules = withConfig({
|
57
35
|
...omit(camundaCloud80Rules, 'no-zeebe-properties'),
|
58
|
-
'
|
59
|
-
|
60
|
-
'inclusive-gateway': 'error',
|
61
|
-
'no-expression': [ 'error', { version: '8.1' } ],
|
62
|
-
'timer': [ 'error', { version: '8.1' } ]
|
63
|
-
};
|
36
|
+
'inclusive-gateway': 'error'
|
37
|
+
}, { version: '8.1' });
|
64
38
|
|
65
|
-
const camundaCloud82Rules = {
|
39
|
+
const camundaCloud82Rules = withConfig({
|
66
40
|
...omit(camundaCloud81Rules, 'no-candidate-users'),
|
67
|
-
'
|
68
|
-
|
69
|
-
'escalation-reference': 'error',
|
70
|
-
'no-expression': [ 'error', { version: '8.2' } ],
|
71
|
-
'timer': [ 'error', { version: '8.2' } ]
|
72
|
-
};
|
41
|
+
'escalation-reference': 'error'
|
42
|
+
}, { version: '8.2' });
|
73
43
|
|
74
44
|
module.exports = {
|
75
45
|
configs: {
|
@@ -95,4 +65,14 @@ module.exports = {
|
|
95
65
|
rules: camundaCloud82Rules
|
96
66
|
}
|
97
67
|
}
|
98
|
-
};
|
68
|
+
};
|
69
|
+
|
70
|
+
function withConfig(rules, config, type = 'error') {
|
71
|
+
let rulesWithConfig = {};
|
72
|
+
|
73
|
+
for (let name in rules) {
|
74
|
+
rulesWithConfig[ name ] = [ type, config ];
|
75
|
+
}
|
76
|
+
|
77
|
+
return rulesWithConfig;
|
78
|
+
}
|
package/package.json
CHANGED
package/rules/called-element.js
CHANGED
@@ -8,7 +8,9 @@ const {
|
|
8
8
|
|
9
9
|
const { reportErrors } = require('./utils/reporter');
|
10
10
|
|
11
|
-
|
11
|
+
const { skipInNonExecutableProcess } = require('./utils/rule');
|
12
|
+
|
13
|
+
module.exports = skipInNonExecutableProcess(function() {
|
12
14
|
function check(node, reporter) {
|
13
15
|
if (!is(node, 'bpmn:CallActivity')) {
|
14
16
|
return;
|
@@ -38,4 +40,4 @@ module.exports = function() {
|
|
38
40
|
return {
|
39
41
|
check
|
40
42
|
};
|
41
|
-
};
|
43
|
+
});
|
@@ -4,7 +4,9 @@ const { ERROR_TYPES } = require('./utils/element');
|
|
4
4
|
|
5
5
|
const { reportErrors } = require('./utils/reporter');
|
6
6
|
|
7
|
-
|
7
|
+
const { skipInNonExecutableProcess } = require('./utils/rule');
|
8
|
+
|
9
|
+
module.exports = skipInNonExecutableProcess(function() {
|
8
10
|
function check(di, reporter) {
|
9
11
|
|
10
12
|
if (!isCollapsedSubProcess(di)) {
|
@@ -28,11 +30,10 @@ module.exports = function() {
|
|
28
30
|
return {
|
29
31
|
check
|
30
32
|
};
|
31
|
-
};
|
32
|
-
|
33
|
+
});
|
33
34
|
|
34
35
|
function isCollapsedSubProcess(di) {
|
35
36
|
return is(di, 'bpmndi:BPMNShape') &&
|
36
|
-
is(di.bpmnElement, 'bpmn:SubProcess') &&
|
37
|
+
is(di.get('bpmnElement'), 'bpmn:SubProcess') &&
|
37
38
|
di.get('isExpanded') !== true;
|
38
39
|
}
|
@@ -11,7 +11,9 @@ const {
|
|
11
11
|
|
12
12
|
const { reportErrors } = require('./utils/reporter');
|
13
13
|
|
14
|
-
|
14
|
+
const { skipInNonExecutableProcess } = require('./utils/rule');
|
15
|
+
|
16
|
+
module.exports = skipInNonExecutableProcess(function() {
|
15
17
|
function check(node, reporter) {
|
16
18
|
if (!is(node, 'bpmn:UserTask') && !isZeebeServiceTask(node)) {
|
17
19
|
return;
|
@@ -33,7 +35,7 @@ module.exports = function() {
|
|
33
35
|
return {
|
34
36
|
check
|
35
37
|
};
|
36
|
-
};
|
38
|
+
});
|
37
39
|
|
38
40
|
// helpers //////////
|
39
41
|
|
@@ -12,7 +12,9 @@ const { ERROR_TYPES } = require('../utils/error-types');
|
|
12
12
|
|
13
13
|
const { reportErrors } = require('../utils/reporter');
|
14
14
|
|
15
|
-
|
15
|
+
const { skipInNonExecutableProcess } = require('../utils/rule');
|
16
|
+
|
17
|
+
module.exports = skipInNonExecutableProcess(function({ version }) {
|
16
18
|
function check(node, reporter) {
|
17
19
|
if (!isAny(node, [ 'bpmn:FlowElement', 'bpmn:FlowElementsContainer' ])) {
|
18
20
|
return;
|
@@ -99,4 +101,4 @@ module.exports = function({ version }) {
|
|
99
101
|
return {
|
100
102
|
check
|
101
103
|
};
|
102
|
-
};
|
104
|
+
});
|
package/rules/error-reference.js
CHANGED
@@ -10,12 +10,20 @@ const {
|
|
10
10
|
|
11
11
|
const { reportErrors } = require('./utils/reporter');
|
12
12
|
|
13
|
-
|
13
|
+
const { skipInNonExecutableProcess } = require('./utils/rule');
|
14
|
+
|
15
|
+
const { greaterOrEqual } = require('./utils/version');
|
16
|
+
|
17
|
+
module.exports = skipInNonExecutableProcess(function({ version }) {
|
14
18
|
function check(node, reporter) {
|
15
19
|
if (!isAny(node, [ 'bpmn:CatchEvent', 'bpmn:ThrowEvent' ])) {
|
16
20
|
return;
|
17
21
|
}
|
18
22
|
|
23
|
+
if (is(node, 'bpmn:CatchEvent') && greaterOrEqual(version, '8.2')) {
|
24
|
+
return;
|
25
|
+
}
|
26
|
+
|
19
27
|
const eventDefinition = getEventDefinition(node);
|
20
28
|
|
21
29
|
if (!eventDefinition || !is(eventDefinition, 'bpmn:ErrorEventDefinition')) {
|
@@ -24,7 +32,8 @@ module.exports = function() {
|
|
24
32
|
|
25
33
|
let errors = hasProperties(eventDefinition, {
|
26
34
|
errorRef: {
|
27
|
-
required: true
|
35
|
+
required: true,
|
36
|
+
allowedVersion: '8.2'
|
28
37
|
}
|
29
38
|
}, node);
|
30
39
|
|
@@ -38,7 +47,8 @@ module.exports = function() {
|
|
38
47
|
|
39
48
|
errors = hasProperties(errorRef, {
|
40
49
|
errorCode: {
|
41
|
-
required: true
|
50
|
+
required: true,
|
51
|
+
allowedVersion: '8.2'
|
42
52
|
}
|
43
53
|
}, node);
|
44
54
|
|
@@ -50,4 +60,4 @@ module.exports = function() {
|
|
50
60
|
return {
|
51
61
|
check
|
52
62
|
};
|
53
|
-
};
|
63
|
+
});
|
@@ -10,7 +10,9 @@ const {
|
|
10
10
|
|
11
11
|
const { reportErrors } = require('./utils/reporter');
|
12
12
|
|
13
|
-
|
13
|
+
const { skipInNonExecutableProcess } = require('./utils/rule');
|
14
|
+
|
15
|
+
module.exports = skipInNonExecutableProcess(function() {
|
14
16
|
function check(node, reporter) {
|
15
17
|
if (!isAny(node, [ 'bpmn:CatchEvent', 'bpmn:ThrowEvent' ])) {
|
16
18
|
return;
|
@@ -50,4 +52,4 @@ module.exports = function() {
|
|
50
52
|
return {
|
51
53
|
check
|
52
54
|
};
|
53
|
-
};
|
55
|
+
});
|
package/rules/feel.js
CHANGED
@@ -10,7 +10,9 @@ const { reportErrors } = require('./utils/reporter');
|
|
10
10
|
|
11
11
|
const { ERROR_TYPES } = require('./utils/error-types');
|
12
12
|
|
13
|
-
|
13
|
+
const { skipInNonExecutableProcess } = require('./utils/rule');
|
14
|
+
|
15
|
+
module.exports = skipInNonExecutableProcess(function() {
|
14
16
|
function check(node, reporter) {
|
15
17
|
if (is(node, 'bpmn:Expression')) {
|
16
18
|
return;
|
@@ -62,7 +64,7 @@ module.exports = function() {
|
|
62
64
|
return {
|
63
65
|
check
|
64
66
|
};
|
65
|
-
};
|
67
|
+
});
|
66
68
|
|
67
69
|
const isFeelProperty = ([ propertyName, value ]) => {
|
68
70
|
return !isIgnoredProperty(propertyName) && isString(value) && value.startsWith('=');
|
@@ -19,7 +19,9 @@ const { reportErrors } = require('../utils/reporter');
|
|
19
19
|
|
20
20
|
const { ERROR_TYPES } = require('../utils/error-types');
|
21
21
|
|
22
|
-
|
22
|
+
const { skipInNonExecutableProcess } = require('../utils/rule');
|
23
|
+
|
24
|
+
module.exports = skipInNonExecutableProcess(function({ version }) {
|
23
25
|
function check(node, reporter) {
|
24
26
|
const calledDecisionConfig = config.calledDecision[ node.$type ];
|
25
27
|
const scriptConfig = config.script[ node.$type ];
|
@@ -175,7 +177,7 @@ module.exports = function({ version }) {
|
|
175
177
|
return {
|
176
178
|
check
|
177
179
|
};
|
178
|
-
};
|
180
|
+
});
|
179
181
|
|
180
182
|
function isCalledDecisionAllowed(node, version) {
|
181
183
|
const { calledDecision } = config;
|
@@ -4,7 +4,9 @@ const { ERROR_TYPES } = require('./utils/element');
|
|
4
4
|
|
5
5
|
const { reportErrors } = require('./utils/reporter');
|
6
6
|
|
7
|
-
|
7
|
+
const { skipInNonExecutableProcess } = require('./utils/rule');
|
8
|
+
|
9
|
+
module.exports = skipInNonExecutableProcess(function() {
|
8
10
|
function check(node, reporter) {
|
9
11
|
if (!is(node, 'bpmn:InclusiveGateway')) {
|
10
12
|
return;
|
@@ -31,4 +33,4 @@ module.exports = function() {
|
|
31
33
|
return {
|
32
34
|
check
|
33
35
|
};
|
34
|
-
};
|
36
|
+
});
|
@@ -8,7 +8,9 @@ const {
|
|
8
8
|
|
9
9
|
const { reportErrors } = require('./utils/reporter');
|
10
10
|
|
11
|
-
|
11
|
+
const { skipInNonExecutableProcess } = require('./utils/rule');
|
12
|
+
|
13
|
+
module.exports = skipInNonExecutableProcess(function() {
|
12
14
|
function check(node, reporter) {
|
13
15
|
if (!is(node, 'bpmn:Activity')) {
|
14
16
|
return;
|
@@ -62,4 +64,4 @@ module.exports = function() {
|
|
62
64
|
return {
|
63
65
|
check
|
64
66
|
};
|
65
|
-
};
|
67
|
+
});
|
@@ -10,7 +10,9 @@ const {
|
|
10
10
|
|
11
11
|
const { reportErrors } = require('./utils/reporter');
|
12
12
|
|
13
|
-
|
13
|
+
const { skipInNonExecutableProcess } = require('./utils/rule');
|
14
|
+
|
15
|
+
module.exports = skipInNonExecutableProcess(function() {
|
14
16
|
function check(node, reporter) {
|
15
17
|
if (!isAny(node, [ 'bpmn:CatchEvent', 'bpmn:ReceiveTask' ])) {
|
16
18
|
return;
|
@@ -56,4 +58,4 @@ module.exports = function() {
|
|
56
58
|
return {
|
57
59
|
check
|
58
60
|
};
|
59
|
-
};
|
61
|
+
});
|
@@ -7,7 +7,9 @@ const {
|
|
7
7
|
|
8
8
|
const { reportErrors } = require('./utils/reporter');
|
9
9
|
|
10
|
-
|
10
|
+
const { skipInNonExecutableProcess } = require('./utils/rule');
|
11
|
+
|
12
|
+
module.exports = skipInNonExecutableProcess(function() {
|
11
13
|
function check(node, reporter) {
|
12
14
|
if (!is(node, 'bpmn:UserTask')) {
|
13
15
|
return;
|
@@ -34,4 +36,4 @@ module.exports = function() {
|
|
34
36
|
return {
|
35
37
|
check
|
36
38
|
};
|
37
|
-
};
|
39
|
+
});
|
package/rules/no-expression.js
CHANGED
@@ -11,6 +11,8 @@ const {
|
|
11
11
|
|
12
12
|
const { reportErrors } = require('./utils/reporter');
|
13
13
|
|
14
|
+
const { skipInNonExecutableProcess } = require('./utils/rule');
|
15
|
+
|
14
16
|
const handlersMap = {
|
15
17
|
'1.0': [
|
16
18
|
checkErrorCode
|
@@ -36,7 +38,7 @@ const handlersMap = {
|
|
36
38
|
]
|
37
39
|
};
|
38
40
|
|
39
|
-
module.exports = noExpressionRule;
|
41
|
+
module.exports = skipInNonExecutableProcess(noExpressionRule);
|
40
42
|
|
41
43
|
/**
|
42
44
|
* Make sure that certain properties do not contain expressions in older versions.
|
package/rules/no-template.js
CHANGED
@@ -2,7 +2,9 @@ const { hasProperties } = require('./utils/element');
|
|
2
2
|
|
3
3
|
const { reportErrors } = require('./utils/reporter');
|
4
4
|
|
5
|
-
|
5
|
+
const { skipInNonExecutableProcess } = require('./utils/rule');
|
6
|
+
|
7
|
+
module.exports = skipInNonExecutableProcess(function() {
|
6
8
|
function check(node, reporter) {
|
7
9
|
const errors = hasProperties(node, {
|
8
10
|
modelerTemplate: {
|
@@ -19,4 +21,4 @@ module.exports = function() {
|
|
19
21
|
return {
|
20
22
|
check
|
21
23
|
};
|
22
|
-
};
|
24
|
+
});
|
@@ -4,7 +4,9 @@ const { hasNoExtensionElement } = require('./utils/element');
|
|
4
4
|
|
5
5
|
const { reportErrors } = require('./utils/reporter');
|
6
6
|
|
7
|
-
|
7
|
+
const { skipInNonExecutableProcess } = require('./utils/rule');
|
8
|
+
|
9
|
+
module.exports = skipInNonExecutableProcess(function() {
|
8
10
|
function check(node, reporter) {
|
9
11
|
if (!is(node, 'zeebe:PropertiesHolder')) {
|
10
12
|
return;
|
@@ -20,4 +22,4 @@ module.exports = function() {
|
|
20
22
|
return {
|
21
23
|
check
|
22
24
|
};
|
23
|
-
};
|
25
|
+
});
|
@@ -4,7 +4,9 @@ const { hasProperties } = require('./utils/element');
|
|
4
4
|
|
5
5
|
const { reportErrors } = require('./utils/reporter');
|
6
6
|
|
7
|
-
|
7
|
+
const { skipInNonExecutableProcess } = require('./utils/rule');
|
8
|
+
|
9
|
+
module.exports = skipInNonExecutableProcess(function() {
|
8
10
|
function check(node, reporter) {
|
9
11
|
if (!isAny(node, [ 'bpmn:ExclusiveGateway', 'bpmn:InclusiveGateway' ])) {
|
10
12
|
return;
|
@@ -32,4 +34,4 @@ module.exports = function() {
|
|
32
34
|
return {
|
33
35
|
check
|
34
36
|
};
|
35
|
-
};
|
37
|
+
});
|
package/rules/subscription.js
CHANGED
@@ -12,7 +12,9 @@ const {
|
|
12
12
|
|
13
13
|
const { reportErrors } = require('./utils/reporter');
|
14
14
|
|
15
|
-
|
15
|
+
const { skipInNonExecutableProcess } = require('./utils/rule');
|
16
|
+
|
17
|
+
module.exports = skipInNonExecutableProcess(function() {
|
16
18
|
function check(node, reporter) {
|
17
19
|
if (!isAny(node, [ 'bpmn:CatchEvent', 'bpmn:ThrowEvent', 'bpmn:ReceiveTask' ])
|
18
20
|
|| (is(node, 'bpmn:StartEvent') && !is(node.$parent, 'bpmn:SubProcess'))) {
|
@@ -61,4 +63,4 @@ module.exports = function() {
|
|
61
63
|
return {
|
62
64
|
check
|
63
65
|
};
|
64
|
-
};
|
66
|
+
});
|
package/rules/timer/index.js
CHANGED
@@ -23,7 +23,9 @@ const {
|
|
23
23
|
|
24
24
|
const { reportErrors } = require('../utils/reporter');
|
25
25
|
|
26
|
-
|
26
|
+
const { skipInNonExecutableProcess } = require('../utils/rule');
|
27
|
+
|
28
|
+
module.exports = skipInNonExecutableProcess(function({ version }) {
|
27
29
|
function check(node, reporter) {
|
28
30
|
if (!is(node, 'bpmn:Event')) {
|
29
31
|
return;
|
@@ -53,7 +55,7 @@ module.exports = function({ version }) {
|
|
53
55
|
return {
|
54
56
|
check
|
55
57
|
};
|
56
|
-
};
|
58
|
+
});
|
57
59
|
|
58
60
|
function checkTimePropertyExists(eventDefinition, event) {
|
59
61
|
if (is(event, 'bpmn:StartEvent')) {
|
package/rules/user-task-form.js
CHANGED
@@ -8,7 +8,9 @@ const {
|
|
8
8
|
|
9
9
|
const { reportErrors } = require('./utils/reporter');
|
10
10
|
|
11
|
-
|
11
|
+
const { skipInNonExecutableProcess } = require('./utils/rule');
|
12
|
+
|
13
|
+
module.exports = skipInNonExecutableProcess(function() {
|
12
14
|
function check(node, reporter) {
|
13
15
|
if (!is(node, 'bpmn:UserTask')) {
|
14
16
|
return;
|
@@ -54,7 +56,7 @@ module.exports = function() {
|
|
54
56
|
return {
|
55
57
|
check
|
56
58
|
};
|
57
|
-
};
|
59
|
+
});
|
58
60
|
|
59
61
|
// helpers //////////
|
60
62
|
|
package/rules/utils/element.js
CHANGED
@@ -145,16 +145,18 @@ module.exports.hasProperties = function(node, properties, parentNode = null) {
|
|
145
145
|
return [
|
146
146
|
...results,
|
147
147
|
{
|
148
|
-
message:
|
148
|
+
message: allowedVersion
|
149
|
+
? `Element of type <${ node.$type }> without property <${ propertyName }> only allowed by Camunda Platform ${ allowedVersion } or newer`
|
150
|
+
: `Element of type <${ node.$type }> must have property <${ propertyName }>`,
|
149
151
|
path: path
|
150
152
|
? [ ...path, propertyName ]
|
151
153
|
: [ propertyName ],
|
152
|
-
data: {
|
154
|
+
data: addAllowedVersion({
|
153
155
|
type: ERROR_TYPES.PROPERTY_REQUIRED,
|
154
156
|
node,
|
155
157
|
parentNode: parentNode == node ? null : parentNode,
|
156
158
|
requiredProperty: propertyName
|
157
|
-
}
|
159
|
+
}, allowedVersion)
|
158
160
|
}
|
159
161
|
];
|
160
162
|
}
|
@@ -200,14 +202,13 @@ module.exports.hasProperties = function(node, properties, parentNode = null) {
|
|
200
202
|
path: path
|
201
203
|
? [ ...path, propertyName ]
|
202
204
|
: [ propertyName ],
|
203
|
-
data: {
|
205
|
+
data: addAllowedVersion({
|
204
206
|
type: ERROR_TYPES.PROPERTY_TYPE_NOT_ALLOWED,
|
205
207
|
node,
|
206
208
|
parentNode: parentNode == node ? null : parentNode,
|
207
209
|
property: propertyName,
|
208
|
-
allowedPropertyType: propertyChecks.type
|
209
|
-
|
210
|
-
}
|
210
|
+
allowedPropertyType: propertyChecks.type
|
211
|
+
}, allowedVersion)
|
211
212
|
}
|
212
213
|
];
|
213
214
|
}
|
@@ -241,13 +242,12 @@ module.exports.hasProperties = function(node, properties, parentNode = null) {
|
|
241
242
|
path: path
|
242
243
|
? [ ...path, propertyName ]
|
243
244
|
: [ propertyName ],
|
244
|
-
data: {
|
245
|
+
data: addAllowedVersion({
|
245
246
|
type: ERROR_TYPES.PROPERTY_NOT_ALLOWED,
|
246
247
|
node,
|
247
248
|
parentNode: parentNode == node ? null : parentNode,
|
248
|
-
property: propertyName
|
249
|
-
|
250
|
-
}
|
249
|
+
property: propertyName
|
250
|
+
}, allowedVersion)
|
251
251
|
}
|
252
252
|
];
|
253
253
|
}
|
@@ -262,13 +262,12 @@ module.exports.hasProperties = function(node, properties, parentNode = null) {
|
|
262
262
|
path: path
|
263
263
|
? [ ...path, propertyName ]
|
264
264
|
: [ propertyName ],
|
265
|
-
data: {
|
265
|
+
data: addAllowedVersion({
|
266
266
|
type: ERROR_TYPES.PROPERTY_VALUE_NOT_ALLOWED,
|
267
267
|
node,
|
268
268
|
parentNode: parentNode == node ? null : parentNode,
|
269
|
-
property: propertyName
|
270
|
-
|
271
|
-
}
|
269
|
+
property: propertyName
|
270
|
+
}, allowedVersion)
|
272
271
|
}
|
273
272
|
];
|
274
273
|
}
|
@@ -344,13 +343,12 @@ module.exports.hasNoExtensionElement = function(node, type, parentNode = null, a
|
|
344
343
|
? `Extension element of type <${ type }> only allowed by Camunda Platform ${ allowedVersion }`
|
345
344
|
: `Extension element of type <${ type }> not allowed`,
|
346
345
|
path: getPath(extensionElement, parentNode),
|
347
|
-
data: {
|
346
|
+
data: addAllowedVersion({
|
348
347
|
type: ERROR_TYPES.EXTENSION_ELEMENT_NOT_ALLOWED,
|
349
348
|
node,
|
350
349
|
parentNode: parentNode == node ? null : parentNode,
|
351
|
-
extensionElement
|
352
|
-
|
353
|
-
}
|
350
|
+
extensionElement
|
351
|
+
}, allowedVersion)
|
354
352
|
}
|
355
353
|
];
|
356
354
|
}
|
@@ -407,13 +405,12 @@ module.exports.hasExpression = function(node, propertyName, check, parentNode =
|
|
407
405
|
path: path
|
408
406
|
? [ ...path, propertyName ]
|
409
407
|
: null,
|
410
|
-
data: {
|
408
|
+
data: addAllowedVersion({
|
411
409
|
type: ERROR_TYPES.EXPRESSION_VALUE_NOT_ALLOWED,
|
412
410
|
node: expression,
|
413
411
|
parentNode,
|
414
|
-
property: propertyName
|
415
|
-
|
416
|
-
}
|
412
|
+
property: propertyName
|
413
|
+
}, allowedVersion)
|
417
414
|
}
|
418
415
|
];
|
419
416
|
}
|
@@ -438,3 +435,14 @@ function truncate(string, maxLength = 10) {
|
|
438
435
|
|
439
436
|
return stringified.length > maxLength ? `${ stringified.slice(0, maxLength) }...` : stringified;
|
440
437
|
}
|
438
|
+
|
439
|
+
function addAllowedVersion(data, allowedVersion) {
|
440
|
+
if (!allowedVersion) {
|
441
|
+
return data;
|
442
|
+
}
|
443
|
+
|
444
|
+
return {
|
445
|
+
...data,
|
446
|
+
allowedVersion
|
447
|
+
};
|
448
|
+
}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
const { is } = require('bpmnlint-utils');
|
2
|
+
|
3
|
+
const { greaterOrEqual } = require('./version');
|
4
|
+
|
5
|
+
function skipInNonExecutableProcess(ruleFactory) {
|
6
|
+
return function(config = {}) {
|
7
|
+
const rule = ruleFactory(config);
|
8
|
+
|
9
|
+
const { version } = config;
|
10
|
+
|
11
|
+
function check(node, reporter) {
|
12
|
+
if (version && greaterOrEqual(version, '8.2') && isNonExecutableProcess(node)) {
|
13
|
+
return false;
|
14
|
+
}
|
15
|
+
|
16
|
+
return rule.check(node, reporter);
|
17
|
+
}
|
18
|
+
|
19
|
+
return {
|
20
|
+
...rule,
|
21
|
+
check
|
22
|
+
};
|
23
|
+
};
|
24
|
+
}
|
25
|
+
|
26
|
+
module.exports = {
|
27
|
+
skipInNonExecutableProcess
|
28
|
+
};
|
29
|
+
|
30
|
+
function isNonExecutableProcess(node) {
|
31
|
+
let process;
|
32
|
+
|
33
|
+
if (is(node, 'bpmn:Process')) {
|
34
|
+
process = node;
|
35
|
+
}
|
36
|
+
|
37
|
+
if (is(node, 'bpmndi:BPMNPlane')
|
38
|
+
&& is(node.get('bpmnElement'), 'bpmn:Process')) {
|
39
|
+
process = node.get('bpmnElement');
|
40
|
+
}
|
41
|
+
|
42
|
+
return process && !process.get('isExecutable');
|
43
|
+
}
|