bpmnlint-plugin-camunda-compat 0.6.3 → 0.8.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/CHANGELOG.md +19 -2
- package/README.md +5 -6
- package/index.js +50 -28
- package/package.json +4 -5
- package/rules/called-decision-or-task-definition/config.js +36 -0
- package/rules/called-decision-or-task-definition/index.js +122 -0
- package/rules/called-element.js +41 -0
- package/rules/element-type/config.js +186 -0
- package/rules/element-type/index.js +86 -0
- package/rules/error-reference.js +53 -0
- package/rules/loop-characteristics.js +65 -0
- package/rules/message-reference.js +59 -0
- package/rules/no-template.js +21 -0
- package/rules/subscription.js +64 -0
- package/rules/utils/element.js +99 -517
- package/rules/utils/error-types.js +9 -0
- package/rules/utils/reporter.js +11 -0
- package/rules/camunda-cloud-1-0-checks.js +0 -245
- package/rules/camunda-cloud-1-0.js +0 -5
- package/rules/camunda-cloud-1-1-checks.js +0 -89
- package/rules/camunda-cloud-1-1.js +0 -5
- package/rules/camunda-cloud-1-2-checks.js +0 -60
- package/rules/camunda-cloud-1-2.js +0 -5
- package/rules/camunda-cloud-1-3-checks.js +0 -37
- package/rules/camunda-cloud-1-3.js +0 -5
- package/rules/camunda-cloud-8-0-checks.js +0 -5
- package/rules/camunda-cloud-8-0.js +0 -5
- package/rules/camunda-platform-7-15.js +0 -3
- package/rules/camunda-platform-7-16.js +0 -3
- package/rules/camunda-platform-7-17.js +0 -3
- package/rules/utils/cloud/element.js +0 -105
- package/rules/utils/engine-profile.js +0 -10
- package/rules/utils/rule.js +0 -324
- package/rules/utils/type.js +0 -47
@@ -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:ErrorEventDefinition')) {
|
22
|
+
return;
|
23
|
+
}
|
24
|
+
|
25
|
+
let errors = hasProperties(eventDefinition, {
|
26
|
+
errorRef: {
|
27
|
+
required: true
|
28
|
+
}
|
29
|
+
}, node);
|
30
|
+
|
31
|
+
if (errors && errors.length) {
|
32
|
+
reportErrors(node, reporter, errors);
|
33
|
+
|
34
|
+
return;
|
35
|
+
}
|
36
|
+
|
37
|
+
const errorRef = eventDefinition.get('errorRef');
|
38
|
+
|
39
|
+
errors = hasProperties(errorRef, {
|
40
|
+
errorCode: {
|
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,65 @@
|
|
1
|
+
const { is } = require('bpmnlint-utils');
|
2
|
+
|
3
|
+
const {
|
4
|
+
findExtensionElement,
|
5
|
+
hasProperties,
|
6
|
+
hasExtensionElementOfType
|
7
|
+
} = require('./utils/element');
|
8
|
+
|
9
|
+
const { reportErrors } = require('./utils/reporter');
|
10
|
+
|
11
|
+
module.exports = function() {
|
12
|
+
function check(node, reporter) {
|
13
|
+
if (!is(node, 'bpmn:Activity')) {
|
14
|
+
return;
|
15
|
+
}
|
16
|
+
|
17
|
+
let loopCharacteristics = node.get('loopCharacteristics');
|
18
|
+
|
19
|
+
if (!loopCharacteristics) {
|
20
|
+
return;
|
21
|
+
}
|
22
|
+
|
23
|
+
let errors = hasProperties(node, {
|
24
|
+
loopCharacteristics: {
|
25
|
+
type: 'bpmn:MultiInstanceLoopCharacteristics'
|
26
|
+
}
|
27
|
+
}, node);
|
28
|
+
|
29
|
+
if (errors && errors.length) {
|
30
|
+
reportErrors(node, reporter, errors);
|
31
|
+
|
32
|
+
return;
|
33
|
+
}
|
34
|
+
|
35
|
+
errors = hasExtensionElementOfType(loopCharacteristics, 'zeebe:LoopCharacteristics', node);
|
36
|
+
|
37
|
+
if (errors && errors.length) {
|
38
|
+
reportErrors(node, reporter, errors);
|
39
|
+
|
40
|
+
return;
|
41
|
+
}
|
42
|
+
|
43
|
+
loopCharacteristics = findExtensionElement(loopCharacteristics, 'zeebe:LoopCharacteristics');
|
44
|
+
|
45
|
+
errors = hasProperties(loopCharacteristics, {
|
46
|
+
inputCollection: {
|
47
|
+
required: true
|
48
|
+
},
|
49
|
+
outputCollection: {
|
50
|
+
dependendRequired: 'outputElement'
|
51
|
+
},
|
52
|
+
outputElement: {
|
53
|
+
dependendRequired: 'outputCollection'
|
54
|
+
}
|
55
|
+
}, node);
|
56
|
+
|
57
|
+
if (errors && errors.length) {
|
58
|
+
reportErrors(node, reporter, errors);
|
59
|
+
}
|
60
|
+
}
|
61
|
+
|
62
|
+
return {
|
63
|
+
check
|
64
|
+
};
|
65
|
+
};
|
@@ -0,0 +1,59 @@
|
|
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:ReceiveTask' ])) {
|
16
|
+
return;
|
17
|
+
}
|
18
|
+
|
19
|
+
let eventDefinitionOrReceiveTask = node;
|
20
|
+
|
21
|
+
if (!is(node, 'bpmn:ReceiveTask')) {
|
22
|
+
const eventDefinition = getEventDefinition(node);
|
23
|
+
|
24
|
+
if (!eventDefinition || !is(eventDefinition, 'bpmn:MessageEventDefinition')) {
|
25
|
+
return;
|
26
|
+
}
|
27
|
+
|
28
|
+
eventDefinitionOrReceiveTask = eventDefinition;
|
29
|
+
}
|
30
|
+
|
31
|
+
let errors = hasProperties(eventDefinitionOrReceiveTask, {
|
32
|
+
messageRef: {
|
33
|
+
required: true
|
34
|
+
}
|
35
|
+
}, node);
|
36
|
+
|
37
|
+
if (errors && errors.length) {
|
38
|
+
reportErrors(node, reporter, errors);
|
39
|
+
|
40
|
+
return;
|
41
|
+
}
|
42
|
+
|
43
|
+
const messageRef = eventDefinitionOrReceiveTask.get('messageRef');
|
44
|
+
|
45
|
+
errors = hasProperties(messageRef, {
|
46
|
+
name: {
|
47
|
+
required: true
|
48
|
+
}
|
49
|
+
}, node);
|
50
|
+
|
51
|
+
if (errors && errors.length) {
|
52
|
+
reportErrors(node, reporter, errors);
|
53
|
+
}
|
54
|
+
}
|
55
|
+
|
56
|
+
return {
|
57
|
+
check
|
58
|
+
};
|
59
|
+
};
|
@@ -0,0 +1,21 @@
|
|
1
|
+
const { hasProperties } = require('./utils/element');
|
2
|
+
|
3
|
+
const { reportErrors } = require('./utils/reporter');
|
4
|
+
|
5
|
+
module.exports = function() {
|
6
|
+
function check(node, reporter) {
|
7
|
+
const errors = hasProperties(node, {
|
8
|
+
modelerTemplate: {
|
9
|
+
allowed: false
|
10
|
+
}
|
11
|
+
}, node);
|
12
|
+
|
13
|
+
if (errors && errors.length) {
|
14
|
+
reportErrors(node, reporter, errors);
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
return {
|
19
|
+
check
|
20
|
+
};
|
21
|
+
};
|
@@ -0,0 +1,64 @@
|
|
1
|
+
const {
|
2
|
+
is,
|
3
|
+
isAny
|
4
|
+
} = require('bpmnlint-utils');
|
5
|
+
|
6
|
+
const {
|
7
|
+
findExtensionElement,
|
8
|
+
getEventDefinition,
|
9
|
+
hasExtensionElementOfType,
|
10
|
+
hasProperties
|
11
|
+
} = require('./utils/element');
|
12
|
+
|
13
|
+
const { reportErrors } = require('./utils/reporter');
|
14
|
+
|
15
|
+
module.exports = function() {
|
16
|
+
function check(node, reporter) {
|
17
|
+
if (!isAny(node, [ 'bpmn:CatchEvent', 'bpmn:ThrowEvent', 'bpmn:ReceiveTask' ])
|
18
|
+
|| (is(node, 'bpmn:StartEvent') && !is(node.$parent, 'bpmn:SubProcess'))) {
|
19
|
+
return;
|
20
|
+
}
|
21
|
+
|
22
|
+
let eventDefinitionOrReceiveTask = node;
|
23
|
+
|
24
|
+
if (!is(node, 'bpmn:ReceiveTask')) {
|
25
|
+
const eventDefinition = getEventDefinition(node);
|
26
|
+
|
27
|
+
if (!eventDefinition || !is(eventDefinition, 'bpmn:MessageEventDefinition')) {
|
28
|
+
return;
|
29
|
+
}
|
30
|
+
|
31
|
+
eventDefinitionOrReceiveTask = eventDefinition;
|
32
|
+
}
|
33
|
+
|
34
|
+
const messageRef = eventDefinitionOrReceiveTask.get('messageRef');
|
35
|
+
|
36
|
+
if (!messageRef) {
|
37
|
+
return;
|
38
|
+
}
|
39
|
+
|
40
|
+
let errors = hasExtensionElementOfType(messageRef, 'zeebe:Subscription', node);
|
41
|
+
|
42
|
+
if (errors && errors.length) {
|
43
|
+
reportErrors(node, reporter, errors);
|
44
|
+
|
45
|
+
return;
|
46
|
+
}
|
47
|
+
|
48
|
+
const subscription = findExtensionElement(messageRef, 'zeebe:Subscription');
|
49
|
+
|
50
|
+
errors = hasProperties(subscription, {
|
51
|
+
correlationKey: {
|
52
|
+
required: true
|
53
|
+
}
|
54
|
+
}, node);
|
55
|
+
|
56
|
+
if (errors && errors.length) {
|
57
|
+
reportErrors(node, reporter, errors);
|
58
|
+
}
|
59
|
+
}
|
60
|
+
|
61
|
+
return {
|
62
|
+
check
|
63
|
+
};
|
64
|
+
};
|