bpmnlint-plugin-camunda-compat 2.40.0 → 2.41.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bpmnlint-plugin-camunda-compat",
3
- "version": "2.40.0",
3
+ "version": "2.41.0",
4
4
  "description": "A bpmnlint plug-in for Camunda compatibility",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -3,6 +3,7 @@ module.exports = {
3
3
  'bpmn:BusinessRuleTask': '1.3'
4
4
  },
5
5
  taskDefinition: {
6
+ 'bpmn:AdHocSubProcess': '8.8',
6
7
  'bpmn:BusinessRuleTask': '1.1',
7
8
  'bpmn:IntermediateThrowEvent': {
8
9
  'bpmn:MessageEventDefinition': '1.2'
@@ -27,13 +27,6 @@ module.exports = skipInNonExecutableProcess(function({ version }) {
27
27
  const scriptConfig = config.script[ node.$type ];
28
28
  const taskDefinitionConfig = config.taskDefinition[ node.$type ];
29
29
 
30
- if (
31
- (!calledDecisionConfig || (isString(calledDecisionConfig) && !greaterOrEqual(version, calledDecisionConfig)))
32
- && (!scriptConfig || (isString(scriptConfig) && !greaterOrEqual(version, scriptConfig)))
33
- && (!taskDefinitionConfig || (isString(taskDefinitionConfig) && !greaterOrEqual(version, taskDefinitionConfig)))) {
34
- return;
35
- }
36
-
37
30
  if (is(node, 'bpmn:ThrowEvent') && !getEventDefinition(node)) {
38
31
  return;
39
32
  }
@@ -150,6 +143,8 @@ module.exports = skipInNonExecutableProcess(function({ version }) {
150
143
 
151
144
  if (errors && errors.length) {
152
145
  reportErrors(node, reporter, errors);
146
+
147
+ return;
153
148
  }
154
149
  }
155
150
 
@@ -161,9 +156,9 @@ module.exports = skipInNonExecutableProcess(function({ version }) {
161
156
 
162
157
  if (allowedTypes.length === 0) {
163
158
  return;
164
- } else if (allowedTypes.length === 1) {
159
+ } else if (allowedTypes.length === 1 && !canHaveExtensionlessImplementation(node)) {
165
160
  errors = hasExtensionElement(node, allowedTypes[0], node);
166
- } else {
161
+ } else if (!canHaveExtensionlessImplementation(node)) {
167
162
  errors = hasExtensionElement(node, allowedTypes, node);
168
163
  }
169
164
 
@@ -216,3 +211,11 @@ function getAllowedVersion(config, node) {
216
211
 
217
212
  return eventDefinition && config[ eventDefinition.$type ];
218
213
  }
214
+
215
+ /**
216
+ * Check if a BPMN element can have an extension-less implementation
217
+ * (e.g. ad-hoc subprocess with implementation type BPMN).
218
+ */
219
+ function canHaveExtensionlessImplementation(node) {
220
+ return is(node, 'bpmn:AdHocSubProcess');
221
+ }