bpmnlint-plugin-camunda-compat 0.3.0 → 0.6.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.
@@ -0,0 +1,5 @@
1
+ const { createRule } = require('./utils/rule');
2
+
3
+ const checks = require('./camunda-cloud-8-0-checks');
4
+
5
+ module.exports = createRule('Camunda Cloud', '8.0', checks, 'Camunda Platform 8');
@@ -0,0 +1,105 @@
1
+ const { checkEvery } = require('../rule');
2
+
3
+ const {
4
+ checkFlowNode,
5
+ checkLoopCharacteristics,
6
+ checkMessage,
7
+ hasExtensionElementOfType,
8
+ hasExtensionElementsOfTypes,
9
+ checkIf,
10
+ hasMultiInstanceLoopCharacteristics,
11
+ hasLoopCharacteristics
12
+ } = require('../element');
13
+
14
+ module.exports.hasZeebeCalledDecisionOrTaskDefinition = checkFlowNode(
15
+ hasExtensionElementsOfTypes([
16
+ {
17
+ type: 'zeebe:CalledDecision',
18
+ properties: {
19
+ decisionId: {
20
+ required: true
21
+ },
22
+ resultVariable: {
23
+ required: true
24
+ }
25
+ }
26
+ },
27
+ {
28
+ type: 'zeebe:TaskDefinition',
29
+ properties: {
30
+ type: {
31
+ required: true
32
+ }
33
+ }
34
+ }
35
+ ], true)
36
+ );
37
+
38
+ module.exports.hasZeebeCalledElement = checkFlowNode(
39
+ hasExtensionElementOfType({
40
+ type: 'zeebe:CalledElement',
41
+ properties: {
42
+ processId: {
43
+ required: true
44
+ }
45
+ }
46
+ })
47
+ );
48
+
49
+ /**
50
+ * Check if one of the following is true:
51
+ *
52
+ * 1. no loop characteristics
53
+ * 2. bpmn:MultiInstanceLoopCharacteristics with zeebe:LoopCharacteristics
54
+ * extension element with zeebe:inputCollection
55
+ */
56
+ module.exports.hasZeebeLoopCharacteristics = checkEvery(
57
+ checkIf(
58
+ hasMultiInstanceLoopCharacteristics,
59
+ hasLoopCharacteristics
60
+ ),
61
+ checkIf(
62
+ checkLoopCharacteristics(
63
+ hasExtensionElementOfType({
64
+ type: 'zeebe:LoopCharacteristics',
65
+ properties: {
66
+ inputCollection: {
67
+ required: true
68
+ },
69
+ outputCollection: {
70
+ dependendRequired: 'outputElement'
71
+ },
72
+ outputElement: {
73
+ dependendRequired: 'outputCollection'
74
+ }
75
+ }
76
+ })
77
+ ),
78
+ checkEvery(
79
+ hasLoopCharacteristics,
80
+ hasMultiInstanceLoopCharacteristics
81
+ )
82
+ )
83
+ );
84
+
85
+ module.exports.hasZeebeSubscription = checkMessage(
86
+ hasExtensionElementOfType({
87
+ type: 'zeebe:Subscription',
88
+ properties: {
89
+ correlationKey: {
90
+ required: true
91
+ }
92
+ }
93
+ })
94
+ );
95
+
96
+ module.exports.hasZeebeTaskDefinition = checkFlowNode(
97
+ hasExtensionElementOfType({
98
+ type: 'zeebe:TaskDefinition',
99
+ properties: {
100
+ type: {
101
+ required: true
102
+ }
103
+ }
104
+ })
105
+ );