bpmnlint-plugin-camunda-compat 0.11.0 → 0.12.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 +5 -1
- package/package.json +1 -1
- package/rules/element-type/config.js +107 -172
- package/rules/inclusive-gateway.js +52 -0
package/index.js
CHANGED
@@ -36,7 +36,11 @@ const camundaCloud13Rules = {
|
|
36
36
|
|
37
37
|
const camundaCloud80Rules = omit(camundaCloud13Rules, 'no-template');
|
38
38
|
|
39
|
-
const camundaCloud81Rules =
|
39
|
+
const camundaCloud81Rules = {
|
40
|
+
...omit(camundaCloud80Rules, 'no-zeebe-properties'),
|
41
|
+
'element-type': [ 'error', elementTypeConfig.camundaCloud81 ],
|
42
|
+
'inclusive-gateway': 'error'
|
43
|
+
};
|
40
44
|
|
41
45
|
module.exports = {
|
42
46
|
configs: {
|
package/package.json
CHANGED
@@ -1,186 +1,121 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
'bpmn:UserTask'
|
25
|
-
],
|
26
|
-
elementsNoEventDefinitionRequired: [
|
27
|
-
'bpmn:EndEvent',
|
28
|
-
'bpmn:StartEvent'
|
29
|
-
],
|
30
|
-
eventDefinitions: {
|
31
|
-
'bpmn:BoundaryEvent': [
|
32
|
-
'bpmn:ErrorEventDefinition',
|
33
|
-
'bpmn:MessageEventDefinition',
|
34
|
-
'bpmn:TimerEventDefinition'
|
35
|
-
],
|
36
|
-
'bpmn:EndEvent': [
|
37
|
-
'bpmn:ErrorEventDefinition'
|
38
|
-
],
|
39
|
-
'bpmn:IntermediateCatchEvent': [
|
40
|
-
'bpmn:MessageEventDefinition',
|
41
|
-
'bpmn:TimerEventDefinition'
|
42
|
-
],
|
43
|
-
'bpmn:StartEvent': [
|
44
|
-
'bpmn:ErrorEventDefinition',
|
45
|
-
'bpmn:MessageEventDefinition',
|
46
|
-
'bpmn:TimerEventDefinition'
|
47
|
-
]
|
48
|
-
}
|
49
|
-
},
|
50
|
-
camundaCloud11: {
|
51
|
-
elements: [
|
1
|
+
const camundaCloud10Elements = [
|
2
|
+
'bpmn:Association',
|
3
|
+
'bpmn:BoundaryEvent',
|
4
|
+
'bpmn:CallActivity',
|
5
|
+
'bpmn:Collaboration',
|
6
|
+
'bpmn:Definitions',
|
7
|
+
'bpmn:EndEvent',
|
8
|
+
'bpmn:EventBasedGateway',
|
9
|
+
'bpmn:ExclusiveGateway',
|
10
|
+
'bpmn:Group',
|
11
|
+
'bpmn:IntermediateCatchEvent',
|
12
|
+
'bpmn:MessageFlow',
|
13
|
+
'bpmn:ParallelGateway',
|
14
|
+
'bpmn:Participant',
|
15
|
+
'bpmn:Process',
|
16
|
+
'bpmn:ReceiveTask',
|
17
|
+
'bpmn:SequenceFlow',
|
18
|
+
'bpmn:ServiceTask',
|
19
|
+
'bpmn:StartEvent',
|
20
|
+
'bpmn:SubProcess',
|
21
|
+
'bpmn:TextAnnotation',
|
22
|
+
'bpmn:UserTask'
|
23
|
+
];
|
52
24
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
'bpmn:ExclusiveGateway',
|
62
|
-
'bpmn:Group',
|
63
|
-
'bpmn:IntermediateCatchEvent',
|
64
|
-
'bpmn:MessageFlow',
|
65
|
-
'bpmn:ParallelGateway',
|
66
|
-
'bpmn:Participant',
|
67
|
-
'bpmn:Process',
|
68
|
-
'bpmn:ReceiveTask',
|
69
|
-
'bpmn:SequenceFlow',
|
70
|
-
'bpmn:ServiceTask',
|
71
|
-
'bpmn:StartEvent',
|
72
|
-
'bpmn:SubProcess',
|
73
|
-
'bpmn:TextAnnotation',
|
74
|
-
'bpmn:UserTask',
|
25
|
+
const camundaCloud11Elements = [
|
26
|
+
...camundaCloud10Elements,
|
27
|
+
'bpmn:BusinessRuleTask',
|
28
|
+
'bpmn:IntermediateThrowEvent',
|
29
|
+
'bpmn:ManualTask',
|
30
|
+
'bpmn:ScriptTask',
|
31
|
+
'bpmn:SendTask'
|
32
|
+
];
|
75
33
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
'bpmn:ManualTask',
|
80
|
-
'bpmn:ScriptTask',
|
81
|
-
'bpmn:SendTask'
|
82
|
-
],
|
83
|
-
elementsNoEventDefinitionRequired: [
|
34
|
+
const camundaCloud12Elements = [
|
35
|
+
...camundaCloud11Elements
|
36
|
+
];
|
84
37
|
|
85
|
-
|
86
|
-
|
87
|
-
|
38
|
+
const camundaCloud81Elements = [
|
39
|
+
...camundaCloud12Elements,
|
40
|
+
'bpmn:InclusiveGateway'
|
41
|
+
];
|
88
42
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
'bpmn:BoundaryEvent': [
|
94
|
-
'bpmn:ErrorEventDefinition',
|
95
|
-
'bpmn:MessageEventDefinition',
|
96
|
-
'bpmn:TimerEventDefinition'
|
97
|
-
],
|
98
|
-
'bpmn:EndEvent': [
|
99
|
-
'bpmn:ErrorEventDefinition'
|
100
|
-
],
|
101
|
-
'bpmn:IntermediateCatchEvent': [
|
102
|
-
'bpmn:MessageEventDefinition',
|
103
|
-
'bpmn:TimerEventDefinition'
|
104
|
-
],
|
105
|
-
'bpmn:StartEvent': [
|
106
|
-
'bpmn:ErrorEventDefinition',
|
107
|
-
'bpmn:MessageEventDefinition',
|
108
|
-
'bpmn:TimerEventDefinition'
|
109
|
-
]
|
110
|
-
}
|
111
|
-
},
|
112
|
-
camundaCloud12: {
|
113
|
-
elements: [
|
43
|
+
const camundaCloud10ElementsNoEventDefinitionRequired = [
|
44
|
+
'bpmn:EndEvent',
|
45
|
+
'bpmn:StartEvent'
|
46
|
+
];
|
114
47
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
'bpmn:Collaboration',
|
120
|
-
'bpmn:Definitions',
|
121
|
-
'bpmn:EndEvent',
|
122
|
-
'bpmn:EventBasedGateway',
|
123
|
-
'bpmn:ExclusiveGateway',
|
124
|
-
'bpmn:Group',
|
125
|
-
'bpmn:IntermediateCatchEvent',
|
126
|
-
'bpmn:MessageFlow',
|
127
|
-
'bpmn:ParallelGateway',
|
128
|
-
'bpmn:Participant',
|
129
|
-
'bpmn:Process',
|
130
|
-
'bpmn:ReceiveTask',
|
131
|
-
'bpmn:SequenceFlow',
|
132
|
-
'bpmn:ServiceTask',
|
133
|
-
'bpmn:StartEvent',
|
134
|
-
'bpmn:SubProcess',
|
135
|
-
'bpmn:TextAnnotation',
|
136
|
-
'bpmn:UserTask',
|
48
|
+
const camundaCloud11ElementsNoEventDefinitionRequired = [
|
49
|
+
...camundaCloud10ElementsNoEventDefinitionRequired,
|
50
|
+
'bpmn:IntermediateThrowEvent'
|
51
|
+
];
|
137
52
|
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
'bpmn:ManualTask',
|
142
|
-
'bpmn:ScriptTask',
|
143
|
-
'bpmn:SendTask'
|
144
|
-
],
|
145
|
-
elementsNoEventDefinitionRequired: [
|
53
|
+
const camundaCloud12ElementsNoEventDefinitionRequired = [
|
54
|
+
...camundaCloud11ElementsNoEventDefinitionRequired
|
55
|
+
];
|
146
56
|
|
147
|
-
|
148
|
-
|
149
|
-
|
57
|
+
const camundaCloud81ElementsNoEventDefinitionRequired = [
|
58
|
+
...camundaCloud12ElementsNoEventDefinitionRequired
|
59
|
+
];
|
150
60
|
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
61
|
+
const camundaCloud10EventDefinitions = {
|
62
|
+
'bpmn:BoundaryEvent': [
|
63
|
+
'bpmn:ErrorEventDefinition',
|
64
|
+
'bpmn:MessageEventDefinition',
|
65
|
+
'bpmn:TimerEventDefinition'
|
66
|
+
],
|
67
|
+
'bpmn:EndEvent': [
|
68
|
+
'bpmn:ErrorEventDefinition'
|
69
|
+
],
|
70
|
+
'bpmn:IntermediateCatchEvent': [
|
71
|
+
'bpmn:MessageEventDefinition',
|
72
|
+
'bpmn:TimerEventDefinition'
|
73
|
+
],
|
74
|
+
'bpmn:StartEvent': [
|
75
|
+
'bpmn:ErrorEventDefinition',
|
76
|
+
'bpmn:MessageEventDefinition',
|
77
|
+
'bpmn:TimerEventDefinition'
|
78
|
+
]
|
79
|
+
};
|
155
80
|
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
'bpmn:MessageEventDefinition',
|
160
|
-
'bpmn:TimerEventDefinition'
|
161
|
-
],
|
162
|
-
'bpmn:EndEvent': [
|
81
|
+
const camundaCloud11EventDefinitions = {
|
82
|
+
...camundaCloud10EventDefinitions
|
83
|
+
};
|
163
84
|
|
164
|
-
|
165
|
-
|
85
|
+
const camundaCloud12EventDefinitions = {
|
86
|
+
...camundaCloud11EventDefinitions,
|
87
|
+
'bpmn:EndEvent': [
|
88
|
+
...camundaCloud11EventDefinitions['bpmn:EndEvent'],
|
89
|
+
'bpmn:MessageEventDefinition'
|
90
|
+
],
|
91
|
+
'bpmn:IntermediateThrowEvent': [
|
92
|
+
'bpmn:MessageEventDefinition'
|
93
|
+
]
|
94
|
+
};
|
166
95
|
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
'bpmn:IntermediateCatchEvent': [
|
171
|
-
'bpmn:MessageEventDefinition',
|
172
|
-
'bpmn:TimerEventDefinition'
|
173
|
-
],
|
174
|
-
'bpmn:StartEvent': [
|
175
|
-
'bpmn:ErrorEventDefinition',
|
176
|
-
'bpmn:MessageEventDefinition',
|
177
|
-
'bpmn:TimerEventDefinition'
|
178
|
-
],
|
96
|
+
const camundaCloud81EventDefinitions = {
|
97
|
+
...camundaCloud12EventDefinitions
|
98
|
+
};
|
179
99
|
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
100
|
+
module.exports = {
|
101
|
+
camundaCloud10: {
|
102
|
+
elements: camundaCloud10Elements,
|
103
|
+
elementsNoEventDefinitionRequired: camundaCloud10ElementsNoEventDefinitionRequired,
|
104
|
+
eventDefinitions: camundaCloud10EventDefinitions
|
105
|
+
},
|
106
|
+
camundaCloud11: {
|
107
|
+
elements: camundaCloud11Elements,
|
108
|
+
elementsNoEventDefinitionRequired: camundaCloud11ElementsNoEventDefinitionRequired,
|
109
|
+
eventDefinitions: camundaCloud11EventDefinitions
|
110
|
+
},
|
111
|
+
camundaCloud12: {
|
112
|
+
elements: camundaCloud12Elements,
|
113
|
+
elementsNoEventDefinitionRequired: camundaCloud12ElementsNoEventDefinitionRequired,
|
114
|
+
eventDefinitions: camundaCloud12EventDefinitions
|
115
|
+
},
|
116
|
+
camundaCloud81: {
|
117
|
+
elements: camundaCloud81Elements,
|
118
|
+
elementsNoEventDefinitionRequired: camundaCloud81ElementsNoEventDefinitionRequired,
|
119
|
+
eventDefinitions: camundaCloud81EventDefinitions
|
185
120
|
}
|
186
121
|
};
|
@@ -0,0 +1,52 @@
|
|
1
|
+
const { is } = require('bpmnlint-utils');
|
2
|
+
|
3
|
+
const { hasProperties, ERROR_TYPES } = require('./utils/element');
|
4
|
+
|
5
|
+
const { reportErrors } = require('./utils/reporter');
|
6
|
+
|
7
|
+
module.exports = function() {
|
8
|
+
function check(node, reporter) {
|
9
|
+
if (!is(node, 'bpmn:InclusiveGateway')) {
|
10
|
+
return;
|
11
|
+
}
|
12
|
+
|
13
|
+
const incoming = node.get('incoming');
|
14
|
+
|
15
|
+
if (incoming && incoming.length > 1) {
|
16
|
+
const error = {
|
17
|
+
message: `Element of type <${ node.$type }> must have one property <incoming> of type <bpmn:SequenceFlow>`,
|
18
|
+
path: [ 'incoming' ],
|
19
|
+
error: {
|
20
|
+
type: ERROR_TYPES.PROPERTY_NOT_ALLOWED,
|
21
|
+
node,
|
22
|
+
parentNode: null,
|
23
|
+
property: 'incoming'
|
24
|
+
}
|
25
|
+
};
|
26
|
+
|
27
|
+
reportErrors(node, reporter, error);
|
28
|
+
}
|
29
|
+
|
30
|
+
const outgoing = node.get('outgoing');
|
31
|
+
|
32
|
+
if (outgoing && outgoing.length > 1) {
|
33
|
+
for (let sequenceFlow of outgoing) {
|
34
|
+
if (node.get('default') !== sequenceFlow) {
|
35
|
+
const errors = hasProperties(sequenceFlow, {
|
36
|
+
conditionExpression: {
|
37
|
+
required: true
|
38
|
+
}
|
39
|
+
}, sequenceFlow);
|
40
|
+
|
41
|
+
if (errors.length) {
|
42
|
+
reportErrors(sequenceFlow, reporter, errors);
|
43
|
+
}
|
44
|
+
}
|
45
|
+
}
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
return {
|
50
|
+
check
|
51
|
+
};
|
52
|
+
};
|