bpmnlint-plugin-camunda-compat 2.42.0 → 2.43.1

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 CHANGED
@@ -100,6 +100,7 @@ const camundaCloud86Rules = withConfig({
100
100
  const camundaCloud87Rules = withConfig({
101
101
  ...camundaCloud86Rules,
102
102
  'ad-hoc-sub-process': 'error',
103
+ 'no-interrupting-event-subprocess': 'error'
103
104
  }, { version: '8.7' });
104
105
 
105
106
  const camundaCloud88Rules = withConfig({
@@ -169,6 +170,7 @@ const rules = {
169
170
  'no-candidate-users': './rules/camunda-cloud/no-candidate-users',
170
171
  'no-execution-listeners': './rules/camunda-cloud/no-execution-listeners',
171
172
  'no-expression': './rules/camunda-cloud/no-expression',
173
+ 'no-interrupting-event-subprocess': './rules/camunda-cloud/no-interrupting-event-subprocess',
172
174
  'no-loop': './rules/camunda-cloud/no-loop',
173
175
  'no-multiple-none-start-events': './rules/camunda-cloud/no-multiple-none-start-events',
174
176
  'no-priority-definition': './rules/camunda-cloud/no-priority-definition',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bpmnlint-plugin-camunda-compat",
3
- "version": "2.42.0",
3
+ "version": "2.43.1",
4
4
  "description": "A bpmnlint plug-in for Camunda compatibility",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,47 @@
1
+ const { is } = require('bpmnlint-utils');
2
+
3
+ const { reportErrors } = require('../utils/reporter');
4
+
5
+ const { hasProperties } = require('../utils/element');
6
+
7
+
8
+ /**
9
+ * Rule that disallows interrupting start events in event subprocesses
10
+ * that are placed inside ad-hoc subprocesses.
11
+ */
12
+ module.exports = function() {
13
+ function check(node, reporter) {
14
+ if (!is(node, 'bpmn:StartEvent')) {
15
+ return;
16
+ }
17
+
18
+ // Check if parent is event subprocess placed inside an ad-hoc subprocess
19
+ const parent = node.$parent;
20
+ if (!parent || !isEventSubProcess(parent)) {
21
+ return;
22
+ }
23
+
24
+ const grandparent = parent.$parent;
25
+ if (!grandparent || !is(grandparent, 'bpmn:AdHocSubProcess')) {
26
+ return;
27
+ }
28
+
29
+ const errors = hasProperties(node, {
30
+ isInterrupting: {
31
+ value: false
32
+ }
33
+ }, node);
34
+
35
+ if (errors.length) {
36
+ reportErrors(node, reporter, errors);
37
+ }
38
+ }
39
+
40
+ return {
41
+ check: check
42
+ };
43
+ };
44
+
45
+ function isEventSubProcess(node) {
46
+ return is(node, 'bpmn:SubProcess') && node.get('triggeredByEvent');
47
+ }