bpmnlint-plugin-camunda-compat 0.19.0 → 0.20.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 +3 -1
- package/package.json +1 -1
- package/rules/escalation-reference.js +53 -0
- package/rules/no-candidate-users.js +37 -0
package/index.js
CHANGED
@@ -10,6 +10,7 @@ const camundaCloud10Rules = {
|
|
10
10
|
'executable-process': 'error',
|
11
11
|
'loop-characteristics': 'error',
|
12
12
|
'message-reference': 'error',
|
13
|
+
'no-candidate-users': 'error',
|
13
14
|
'no-expression': [ 'error', { version: '1.0' } ],
|
14
15
|
'no-template': 'error',
|
15
16
|
'no-zeebe-properties': 'error',
|
@@ -62,9 +63,10 @@ const camundaCloud81Rules = {
|
|
62
63
|
};
|
63
64
|
|
64
65
|
const camundaCloud82Rules = {
|
65
|
-
...camundaCloud81Rules,
|
66
|
+
...omit(camundaCloud81Rules, 'no-candidate-users'),
|
66
67
|
'implementation': [ 'error', { version: '8.2' } ],
|
67
68
|
'element-type': [ 'error', { version: '8.2' } ],
|
69
|
+
'escalation-reference': 'error',
|
68
70
|
'no-expression': [ 'error', { version: '8.2' } ],
|
69
71
|
'timer': [ 'error', { version: '8.2' } ]
|
70
72
|
};
|
package/package.json
CHANGED
@@ -0,0 +1,53 @@
|
|
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
|
+
module.exports = function() {
|
14
|
+
function check(node, reporter) {
|
15
|
+
if (!isAny(node, [ 'bpmn:CatchEvent', 'bpmn:ThrowEvent' ])) {
|
16
|
+
return;
|
17
|
+
}
|
18
|
+
|
19
|
+
const eventDefinition = getEventDefinition(node);
|
20
|
+
|
21
|
+
if (!eventDefinition || !is(eventDefinition, 'bpmn:EscalationEventDefinition')) {
|
22
|
+
return;
|
23
|
+
}
|
24
|
+
|
25
|
+
let errors = hasProperties(eventDefinition, {
|
26
|
+
escalationRef: {
|
27
|
+
required: true
|
28
|
+
}
|
29
|
+
}, node);
|
30
|
+
|
31
|
+
if (errors && errors.length) {
|
32
|
+
reportErrors(node, reporter, errors);
|
33
|
+
|
34
|
+
return;
|
35
|
+
}
|
36
|
+
|
37
|
+
const escalationRef = eventDefinition.get('escalationRef');
|
38
|
+
|
39
|
+
errors = hasProperties(escalationRef, {
|
40
|
+
escalationCode: {
|
41
|
+
required: true
|
42
|
+
}
|
43
|
+
}, node);
|
44
|
+
|
45
|
+
if (errors && errors.length) {
|
46
|
+
reportErrors(node, reporter, errors);
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
return {
|
51
|
+
check
|
52
|
+
};
|
53
|
+
};
|
@@ -0,0 +1,37 @@
|
|
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
|
+
module.exports = function() {
|
11
|
+
function check(node, reporter) {
|
12
|
+
if (!is(node, 'bpmn:UserTask')) {
|
13
|
+
return;
|
14
|
+
}
|
15
|
+
|
16
|
+
const assignmentDefinition = findExtensionElement(node, 'zeebe:AssignmentDefinition');
|
17
|
+
|
18
|
+
if (!assignmentDefinition) {
|
19
|
+
return;
|
20
|
+
}
|
21
|
+
|
22
|
+
const errors = hasProperties(assignmentDefinition, {
|
23
|
+
candidateUsers: {
|
24
|
+
allowed: false,
|
25
|
+
allowedVersion: '8.2'
|
26
|
+
}
|
27
|
+
}, node);
|
28
|
+
|
29
|
+
if (errors && errors.length) {
|
30
|
+
reportErrors(node, reporter, errors);
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
return {
|
35
|
+
check
|
36
|
+
};
|
37
|
+
};
|