bpmnlint-plugin-camunda-compat 0.22.0 → 0.23.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
@@ -41,6 +41,10 @@ const camundaCloud82Rules = withConfig({
41
41
  'escalation-reference': 'error'
42
42
  }, { version: '8.2' });
43
43
 
44
+ const camundaPlatform719Rules = withConfig({
45
+ 'history-time-to-live': 'error'
46
+ }, { platform: 'camunda-platform', version: '7.19' });
47
+
44
48
  module.exports = {
45
49
  configs: {
46
50
  'camunda-cloud-1-0': {
@@ -63,6 +67,9 @@ module.exports = {
63
67
  },
64
68
  'camunda-cloud-8-2': {
65
69
  rules: camundaCloud82Rules
70
+ },
71
+ 'camunda-platform-7-19': {
72
+ rules: camundaPlatform719Rules
66
73
  }
67
74
  }
68
75
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bpmnlint-plugin-camunda-compat",
3
- "version": "0.22.0",
3
+ "version": "0.23.0",
4
4
  "description": "A bpmnlint plug-in for Camunda Platform compatibility",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -39,6 +39,7 @@
39
39
  "@bpmn-io/feel-lint": "^0.1.1",
40
40
  "@bpmn-io/moddle-utils": "^0.1.0",
41
41
  "bpmnlint-utils": "^1.0.2",
42
+ "camunda-bpmn-moddle": "^7.0.1",
42
43
  "min-dash": "^3.8.1",
43
44
  "semver-compare": "^1.0.0"
44
45
  },
@@ -0,0 +1,31 @@
1
+ const { is } = require('bpmnlint-utils');
2
+
3
+ const { hasProperties } = require('./utils/element');
4
+
5
+ const { reportErrors } = require('./utils/reporter');
6
+
7
+ const { skipInNonExecutableProcess } = require('./utils/rule');
8
+
9
+ module.exports = skipInNonExecutableProcess(function() {
10
+ function check(node, reporter) {
11
+
12
+ if (!is(node, 'bpmn:Process')) {
13
+ return;
14
+ }
15
+
16
+ let errors = hasProperties(node, {
17
+ 'historyTimeToLive': {
18
+ required: true
19
+ }
20
+ }, node);
21
+
22
+ if (errors) {
23
+ reportErrors(node, reporter, errors);
24
+ }
25
+ return;
26
+ }
27
+
28
+ return {
29
+ check
30
+ };
31
+ });
@@ -6,10 +6,14 @@ function skipInNonExecutableProcess(ruleFactory) {
6
6
  return function(config = {}) {
7
7
  const rule = ruleFactory(config);
8
8
 
9
- const { version } = config;
9
+ const { version, platform = 'camunda-cloud' } = config;
10
10
 
11
11
  function check(node, reporter) {
12
- if (version && greaterOrEqual(version, '8.2') && isNonExecutableProcess(node)) {
12
+ if (platform === 'camunda-cloud' && version && greaterOrEqual(version, '8.2') && isNonExecutableProcess(node)) {
13
+ return false;
14
+ }
15
+
16
+ if (platform === 'camunda-platform' && isNonExecutableProcess(node)) {
13
17
  return false;
14
18
  }
15
19