bpmnlint-plugin-camunda-compat 2.16.0 → 2.17.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 CHANGED
@@ -19,6 +19,7 @@ const camundaCloud10Rules = withConfig({
19
19
  'no-task-schedule': 'error',
20
20
  'no-template': 'error',
21
21
  'no-zeebe-properties': 'error',
22
+ 'no-zeebe-user-task': 'error',
22
23
  'sequence-flow-condition': 'error',
23
24
  'start-event-form': 'error',
24
25
  'subscription': 'error',
@@ -65,6 +66,12 @@ const camundaCloud83Rules = withConfig({
65
66
  const camundaCloud84Rules = withConfig(
66
67
  omit(camundaCloud83Rules, 'collapsed-subprocess'), { version: '8.4' });
67
68
 
69
+ const camundaCloud85Rules = withConfig(
70
+ omit(camundaCloud83Rules, [
71
+ 'collapsed-subprocess',
72
+ 'no-zeebe-user-task'
73
+ ]), { version: '8.5' });
74
+
68
75
  const camundaPlatform719Rules = withConfig({
69
76
  'history-time-to-live': 'info'
70
77
  }, {
@@ -108,6 +115,7 @@ const rules = {
108
115
  'no-task-schedule': './rules/camunda-cloud/no-task-schedule',
109
116
  'no-template': './rules/camunda-cloud/no-template',
110
117
  'no-zeebe-properties': './rules/camunda-cloud/no-zeebe-properties',
118
+ 'no-zeebe-user-task': './rules/camunda-cloud/no-zeebe-user-task',
111
119
  'secrets': './rules/camunda-cloud/secrets',
112
120
  'sequence-flow-condition': './rules/camunda-cloud/sequence-flow-condition',
113
121
  'signal-reference': './rules/camunda-cloud/signal-reference',
@@ -147,6 +155,9 @@ const configs = {
147
155
  'camunda-cloud-8-4': {
148
156
  rules: camundaCloud84Rules
149
157
  },
158
+ 'camunda-cloud-8-5': {
159
+ rules: camundaCloud85Rules
160
+ },
150
161
  'camunda-platform-7-19': {
151
162
  rules: camundaPlatform719Rules
152
163
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bpmnlint-plugin-camunda-compat",
3
- "version": "2.16.0",
3
+ "version": "2.17.0",
4
4
  "description": "A bpmnlint plug-in for Camunda compatibility",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,27 @@
1
+ const { is } = require('bpmnlint-utils');
2
+
3
+ const { reportErrors } = require('../utils/reporter');
4
+
5
+ const { skipInNonExecutableProcess } = require('../utils/rule');
6
+
7
+ const { hasNoExtensionElement } = require('../utils/element');
8
+
9
+ const ALLOWED_VERSION = '8.5';
10
+
11
+ module.exports = skipInNonExecutableProcess(function() {
12
+ function check(node, reporter) {
13
+ if (!is(node, 'bpmn:UserTask')) {
14
+ return;
15
+ }
16
+
17
+ const errors = hasNoExtensionElement(node, 'zeebe:UserTask', node, ALLOWED_VERSION);
18
+
19
+ if (errors && errors.length) {
20
+ reportErrors(node, reporter, errors);
21
+ }
22
+ }
23
+
24
+ return {
25
+ check
26
+ };
27
+ });
@@ -19,6 +19,8 @@ const formIdAllowedVersions = {
19
19
  web: '8.0'
20
20
  };
21
21
 
22
+ const ZEEBE_USER_TASK_VERSION = '8.5';
23
+
22
24
  module.exports = skipInNonExecutableProcess(function({ modeler = 'desktop', version }) {
23
25
  function check(node, reporter) {
24
26
  if (!is(node, 'bpmn:UserTask')) {
@@ -31,7 +33,27 @@ module.exports = skipInNonExecutableProcess(function({ modeler = 'desktop', vers
31
33
  return;
32
34
  }
33
35
 
34
- let errors = [];
36
+ // handle Zebee User Task
37
+ if (isZeebeUserTask(node)) {
38
+
39
+ // handled by no-zeebe-user-task rule
40
+ if (!greaterOrEqual(version, ZEEBE_USER_TASK_VERSION)) {
41
+ return;
42
+ }
43
+
44
+ const errors = hasProperty(formDefinition, [
45
+ 'externalReference',
46
+ 'formId'
47
+ ], node) || [];
48
+
49
+ if (errors.length) {
50
+ reportErrors(node, reporter, errors);
51
+ }
52
+
53
+ return;
54
+ }
55
+
56
+ let errors;
35
57
 
36
58
  const formIdAllowedVersion = formIdAllowedVersions[ modeler ];
37
59
 
@@ -113,4 +135,8 @@ function findUserTaskForm(node, formKey) {
113
135
 
114
136
  function isFormIdAllowed(version, formIdAllowedVersion) {
115
137
  return greaterOrEqual(version, formIdAllowedVersion);
116
- }
138
+ }
139
+
140
+ function isZeebeUserTask(node) {
141
+ return !!findExtensionElement(node, 'zeebe:UserTask');
142
+ }