From 17bc4210b97f80593f77b471a141be49d9f06874 Mon Sep 17 00:00:00 2001 From: Maciej Barelkowski Date: Mon, 5 Dec 2022 16:01:09 +0100 Subject: [PATCH] feat: support `zeebe:Script` Closes #67 BREAKING CHANGES: * Renamed `called-decision-or-task-definition` to `implementation`. --- CHANGELOG.md | 8 + index.js | 14 +- package-lock.json | 14 +- package.json | 2 +- .../config.js | 5 +- .../index.js | 80 +++++++-- ...inition.spec.js => implementation.spec.js} | 154 +++++++++++++++++- ...-cloud-1-0-implementation-definition.bpmn} | 0 ...unda-cloud-1-0-implementation-errors.bpmn} | 0 ...-cloud-1-1-implementation-definition.bpmn} | 0 ...unda-cloud-1-1-implementation-errors.bpmn} | 0 ...unda-cloud-1-2-implementation-errors.bpmn} | 0 ... => camunda-cloud-1-2-implementation.bpmn} | 0 ...unda-cloud-1-3-implementation-errors.bpmn} | 0 ... => camunda-cloud-1-3-implementation.bpmn} | 0 ...unda-cloud-8-0-implementation-errors.bpmn} | 0 ... => camunda-cloud-8-0-implementation.bpmn} | 0 ...unda-cloud-8-1-implementation-errors.bpmn} | 0 ... => camunda-cloud-8-1-implementation.bpmn} | 0 ...unda-cloud-8-2-implementation-errors.bpmn} | 0 ... => camunda-cloud-8-2-implementation.bpmn} | 0 ...inition.spec.js => implementation.spec.js} | 10 +- test/config/configs.spec.js | 14 +- 23 files changed, 257 insertions(+), 44 deletions(-) rename rules/{called-decision-or-task-definition => implementation}/config.js (75%) rename rules/{called-decision-or-task-definition => implementation}/index.js (64%) rename test/camunda-cloud/{called-decision-or-task-definition.spec.js => implementation.spec.js} (75%) rename test/camunda-cloud/integration/{camunda-cloud-1-0-called-decision-or-task-definition.bpmn => camunda-cloud-1-0-implementation-definition.bpmn} (100%) rename test/camunda-cloud/integration/{camunda-cloud-1-0-called-decision-or-task-definition-errors.bpmn => camunda-cloud-1-0-implementation-errors.bpmn} (100%) rename test/camunda-cloud/integration/{camunda-cloud-1-1-called-decision-or-task-definition.bpmn => camunda-cloud-1-1-implementation-definition.bpmn} (100%) rename test/camunda-cloud/integration/{camunda-cloud-1-1-called-decision-or-task-definition-errors.bpmn => camunda-cloud-1-1-implementation-errors.bpmn} (100%) rename test/camunda-cloud/integration/{camunda-cloud-1-2-called-decision-or-task-definition-errors.bpmn => camunda-cloud-1-2-implementation-errors.bpmn} (100%) rename test/camunda-cloud/integration/{camunda-cloud-1-2-called-decision-or-task-definition.bpmn => camunda-cloud-1-2-implementation.bpmn} (100%) rename test/camunda-cloud/integration/{camunda-cloud-1-3-called-decision-or-task-definition-errors.bpmn => camunda-cloud-1-3-implementation-errors.bpmn} (100%) rename test/camunda-cloud/integration/{camunda-cloud-1-3-called-decision-or-task-definition.bpmn => camunda-cloud-1-3-implementation.bpmn} (100%) rename test/camunda-cloud/integration/{camunda-cloud-8-0-called-decision-or-task-definition-errors.bpmn => camunda-cloud-8-0-implementation-errors.bpmn} (100%) rename test/camunda-cloud/integration/{camunda-cloud-8-0-called-decision-or-task-definition.bpmn => camunda-cloud-8-0-implementation.bpmn} (100%) rename test/camunda-cloud/integration/{camunda-cloud-8-1-called-decision-or-task-definition-errors.bpmn => camunda-cloud-8-1-implementation-errors.bpmn} (100%) rename test/camunda-cloud/integration/{camunda-cloud-8-1-called-decision-or-task-definition.bpmn => camunda-cloud-8-1-implementation.bpmn} (100%) rename test/camunda-cloud/integration/{camunda-cloud-8-2-called-decision-or-task-definition-errors.bpmn => camunda-cloud-8-2-implementation-errors.bpmn} (100%) rename test/camunda-cloud/integration/{camunda-cloud-8-2-called-decision-or-task-definition.bpmn => camunda-cloud-8-2-implementation.bpmn} (100%) rename test/camunda-cloud/integration/{called-decision-or-task-definition.spec.js => implementation.spec.js} (72%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9dd96ebb..c8dd05de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,14 @@ All notable changes to [bpmnlint-plugin-camunda-compat](https://github.com/camun ___Note:__ Yet to be released changes appear here._ +## 0.17.0 + +* `FEAT`: support `zeebe:Script` ([#67](https://github.com/camunda/bpmnlint-plugin-camunda-compat/issues/67)) + +### Breaking Changes + +* Rule `called-decision-or-task-definition` was renamed to `implementation`. + ## 0.16.0 * `FEAT`: add link events to `element-type` rule ([#63](https://github.com/camunda/bpmnlint-plugin-camunda-compat/pull/63)) diff --git a/index.js b/index.js index adadbb04..4c6e33ba 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,7 @@ const { omit } = require('min-dash'); const camundaCloud10Rules = { - 'called-decision-or-task-definition': [ 'error', { version: '1.0' } ], + 'implementation': [ 'error', { version: '1.0' } ], 'called-element': 'error', 'collapsed-subprocess': 'error', 'duplicate-task-headers': 'error', @@ -21,35 +21,35 @@ const camundaCloud10Rules = { const camundaCloud11Rules = { ...camundaCloud10Rules, - 'called-decision-or-task-definition': [ 'error', { version: '1.1' } ], + 'implementation': [ 'error', { version: '1.1' } ], 'element-type': [ 'error', { version: '1.1' } ], 'timer': [ 'error', { version: '1.1' } ] }; const camundaCloud12Rules = { ...camundaCloud11Rules, - 'called-decision-or-task-definition': [ 'error', { version: '1.2' } ], + 'implementation': [ 'error', { version: '1.2' } ], 'element-type': [ 'error', { version: '1.2' } ], 'timer': [ 'error', { version: '1.2' } ] }; const camundaCloud13Rules = { ...camundaCloud12Rules, - 'called-decision-or-task-definition': [ 'error', { version: '1.3' } ], + 'implementation': [ 'error', { version: '1.3' } ], 'element-type': [ 'error', { version: '1.3' } ], 'timer': [ 'error', { version: '1.3' } ] }; const camundaCloud80Rules = { ...omit(camundaCloud13Rules, 'no-template'), - 'called-decision-or-task-definition': [ 'error', { version: '8.0' } ], + 'implementation': [ 'error', { version: '8.0' } ], 'element-type': [ 'error', { version: '8.0' } ], 'timer': [ 'error', { version: '8.0' } ] }; const camundaCloud81Rules = { ...omit(camundaCloud80Rules, 'no-zeebe-properties'), - 'called-decision-or-task-definition': [ 'error', { version: '8.1' } ], + 'implementation': [ 'error', { version: '8.1' } ], 'element-type': [ 'error', { version: '8.1' } ], 'inclusive-gateway': 'error', 'timer': [ 'error', { version: '8.1' } ] @@ -57,7 +57,7 @@ const camundaCloud81Rules = { const camundaCloud82Rules = { ...camundaCloud81Rules, - 'called-decision-or-task-definition': [ 'error', { version: '8.2' } ], + 'implementation': [ 'error', { version: '8.2' } ], 'element-type': [ 'error', { version: '8.2' } ], 'timer': [ 'error', { version: '8.2' } ] }; diff --git a/package-lock.json b/package-lock.json index 710efb13..4b10e5fb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,7 @@ "modeler-moddle": "^0.1.0", "sinon": "^14.0.0", "sinon-chai": "^3.7.0", - "zeebe-bpmn-moddle": "^0.14.0" + "zeebe-bpmn-moddle": "^0.17.0" } }, "node_modules/@ampproject/remapping": { @@ -3844,9 +3844,9 @@ } }, "node_modules/zeebe-bpmn-moddle": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/zeebe-bpmn-moddle/-/zeebe-bpmn-moddle-0.14.0.tgz", - "integrity": "sha512-NofnLlxxbWfEBcWNQf9JHMZdDVtG/8fuZ3CDr3oxjKe4hrgldthrjdu+6o1h+lTZ+QdClgcArZMijNUsMae2FQ==", + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/zeebe-bpmn-moddle/-/zeebe-bpmn-moddle-0.17.0.tgz", + "integrity": "sha512-Phe0suKe74GuGi/4gESvHeu984kmRHSVmyBJu1UU+MAEFjppk5lrmMNzfu9ebEK/rP9MG5SiSkGJ6/mEr9+tAw==", "dev": true } }, @@ -6668,9 +6668,9 @@ "dev": true }, "zeebe-bpmn-moddle": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/zeebe-bpmn-moddle/-/zeebe-bpmn-moddle-0.14.0.tgz", - "integrity": "sha512-NofnLlxxbWfEBcWNQf9JHMZdDVtG/8fuZ3CDr3oxjKe4hrgldthrjdu+6o1h+lTZ+QdClgcArZMijNUsMae2FQ==", + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/zeebe-bpmn-moddle/-/zeebe-bpmn-moddle-0.17.0.tgz", + "integrity": "sha512-Phe0suKe74GuGi/4gESvHeu984kmRHSVmyBJu1UU+MAEFjppk5lrmMNzfu9ebEK/rP9MG5SiSkGJ6/mEr9+tAw==", "dev": true } } diff --git a/package.json b/package.json index 6ab08a39..f0abba28 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "modeler-moddle": "^0.1.0", "sinon": "^14.0.0", "sinon-chai": "^3.7.0", - "zeebe-bpmn-moddle": "^0.14.0" + "zeebe-bpmn-moddle": "^0.17.0" }, "dependencies": { "@bpmn-io/feel-lint": "^0.1.1", diff --git a/rules/called-decision-or-task-definition/config.js b/rules/implementation/config.js similarity index 75% rename from rules/called-decision-or-task-definition/config.js rename to rules/implementation/config.js index a9d8dfaa..163b8c3e 100644 --- a/rules/called-decision-or-task-definition/config.js +++ b/rules/implementation/config.js @@ -5,10 +5,13 @@ module.exports = { taskDefinition: { 'bpmn:BusinessRuleTask': '1.1', 'bpmn:IntermediateThrowEvent': { - 'bpmn:MessageEventDefinition': '1.2', + 'bpmn:MessageEventDefinition': '1.2' }, 'bpmn:ScriptTask': '1.1', 'bpmn:SendTask': '1.1', 'bpmn:ServiceTask': '1.0' + }, + script: { + 'bpmn:ScriptTask': '8.2' } }; \ No newline at end of file diff --git a/rules/called-decision-or-task-definition/index.js b/rules/implementation/index.js similarity index 64% rename from rules/called-decision-or-task-definition/index.js rename to rules/implementation/index.js index d54f3b63..acb2e265 100644 --- a/rules/called-decision-or-task-definition/index.js +++ b/rules/implementation/index.js @@ -22,10 +22,12 @@ const { ERROR_TYPES } = require('../utils/error-types'); module.exports = function({ version }) { function check(node, reporter) { const calledDecisionConfig = config.calledDecision[ node.$type ]; + const scriptConfig = config.script[ node.$type ]; const taskDefinitionConfig = config.taskDefinition[ node.$type ]; if ( (!calledDecisionConfig || (isString(calledDecisionConfig) && !greaterOrEqual(version, calledDecisionConfig))) + && (!scriptConfig || (isString(scriptConfig) && !greaterOrEqual(version, scriptConfig))) && (!taskDefinitionConfig || (isString(taskDefinitionConfig) && !greaterOrEqual(version, taskDefinitionConfig)))) { return; } @@ -37,9 +39,10 @@ module.exports = function({ version }) { let errors; const calledDecision = findExtensionElement(node, 'zeebe:CalledDecision'), + script = findExtensionElement(node, 'zeebe:Script'), taskDefinition = findExtensionElement(node, 'zeebe:TaskDefinition'); - if (calledDecision && !taskDefinition) { + if (calledDecision && !script && !taskDefinition) { if (!isCalledDecisionAllowed(node, version)) { const allowedVersion = getAllowedVersion(calledDecisionConfig, node); @@ -77,7 +80,45 @@ module.exports = function({ version }) { } } - if (!calledDecision && taskDefinition) { + if (!calledDecision && script && !taskDefinition) { + + if (!isScriptAllowed(node, version)) { + const allowedVersion = getAllowedVersion(scriptConfig, node); + + reportErrors(node, reporter, { + message: allowedVersion + ? `Extension element of type only allowed by Camunda Platform ${ allowedVersion } or newer` + : 'Extension element of type not allowed', + path: getPath(script, node), + data: { + type: ERROR_TYPES.EXTENSION_ELEMENT_NOT_ALLOWED, + node, + parentNode: null, + extensionElement: script, + allowedVersion + } + }); + + return; + } + + errors = hasProperties(script, { + expression: { + required: true + }, + resultVariable: { + required: true + } + }, node); + + if (errors && errors.length) { + reportErrors(node, reporter, errors); + + return; + } + } + + if (!calledDecision && !script && taskDefinition) { if (!isTaskDefinitionAllowed(node, version)) { const allowedVersion = getAllowedVersion(taskDefinitionConfig, node); @@ -110,15 +151,18 @@ module.exports = function({ version }) { } } - if (isCalledDecisionAllowed(node, version) && isTaskDefinitionAllowed(node, version)) { - errors = hasExtensionElement(node, [ - 'zeebe:CalledDecision', - 'zeebe:TaskDefinition' - ], node); - } else if (isCalledDecisionAllowed(node, version)) { - errors = hasExtensionElement(node, 'zeebe:CalledDecision', node); - } else if (isTaskDefinitionAllowed(node, version)) { - errors = hasExtensionElement(node, 'zeebe:TaskDefinition', node); + const allowedTypes = [ + isCalledDecisionAllowed(node, version) ? 'zeebe:CalledDecision' : false, + isScriptAllowed(node, version) ? 'zeebe:Script' : false, + isTaskDefinitionAllowed(node, version) ? 'zeebe:TaskDefinition' : false + ].filter(isAllowed => isAllowed); + + if (allowedTypes.length === 0) { + return; + } else if (allowedTypes.length === 1) { + errors = hasExtensionElement(node, allowedTypes[0], node); + } else { + errors = hasExtensionElement(node, allowedTypes, node); } if (errors && errors.length) { @@ -136,7 +180,17 @@ module.exports = function({ version }) { function isCalledDecisionAllowed(node, version) { const { calledDecision } = config; - return calledDecision[ node.$type ] && greaterOrEqual(version, calledDecision[ node.$type ]); + const allowedVersion = getAllowedVersion(calledDecision[ node.$type ], node); + + return calledDecision[ node.$type ] && greaterOrEqual(version, allowedVersion); +} + +function isScriptAllowed(node, version) { + const { script } = config; + + const allowedVersion = getAllowedVersion(script[ node.$type ], node); + + return allowedVersion && greaterOrEqual(version, allowedVersion); } function isTaskDefinitionAllowed(node, version) { @@ -159,4 +213,4 @@ function getAllowedVersion(config, node) { const eventDefinition = getEventDefinition(node); return eventDefinition && config[ eventDefinition.$type ]; -} \ No newline at end of file +} diff --git a/test/camunda-cloud/called-decision-or-task-definition.spec.js b/test/camunda-cloud/implementation.spec.js similarity index 75% rename from test/camunda-cloud/called-decision-or-task-definition.spec.js rename to test/camunda-cloud/implementation.spec.js index 1de59233..e0fb2fc5 100644 --- a/test/camunda-cloud/called-decision-or-task-definition.spec.js +++ b/test/camunda-cloud/implementation.spec.js @@ -1,6 +1,6 @@ const RuleTester = require('bpmnlint/lib/testers/rule-tester'); -const rule = require('../../rules/called-decision-or-task-definition'); +const rule = require('../../rules/implementation'); const { createModdle, @@ -105,6 +105,28 @@ const valid = [ `)) + }, + { + name: 'script task (task definition) (Camunda Cloud 8.2)', + config: { version: '8.2' }, + moddleElement: createModdle(createProcess(` + + + + + + `)) + }, + { + name: 'script task (script) (Camunda Cloud 8.2)', + config: { version: '8.2' }, + moddleElement: createModdle(createProcess(` + + + + + + `)) } ]; @@ -438,10 +460,136 @@ const invalid = [ requiredProperty: 'type' } } - } + }, + { + name: 'script task (script) (Camunda Cloud 8.1)', + config: { version: '8.1' }, + moddleElement: createModdle(createProcess(` + + + + + + `)), + report: { + id: 'Task_1', + message: 'Extension element of type only allowed by Camunda Platform 8.2 or newer', + path: [ + 'extensionElements', + 'values', + 0 + ], + data: { + type: ERROR_TYPES.EXTENSION_ELEMENT_NOT_ALLOWED, + node: 'Task_1', + parentNode: null, + extensionElement: 'zeebe:Script', + allowedVersion: '8.2' + } + } + }, + { + name: 'script task (no script or task definition) (Camunda Cloud 8.2)', + config: { version: '8.2' }, + moddleElement: createModdle(createProcess('')), + report: { + id: 'Task_1', + message: 'Element of type must have one extension element of type or ', + path: [], + data: { + type: ERROR_TYPES.EXTENSION_ELEMENT_REQUIRED, + node: 'Task_1', + parentNode: null, + requiredExtensionElement: [ + 'zeebe:Script', + 'zeebe:TaskDefinition' + ] + } + } + }, + { + name: 'script task (script and task definition) (Camunda Cloud 8.2)', + config: { version: '8.2' }, + moddleElement: createModdle(createProcess(` + + + + + + + `)), + report: { + id: 'Task_1', + message: 'Element of type must have one extension element of type or ', + path: [], + data: { + type: ERROR_TYPES.EXTENSION_ELEMENT_REQUIRED, + node: 'Task_1', + parentNode: null, + requiredExtensionElement: [ + 'zeebe:Script', + 'zeebe:TaskDefinition' + ] + } + } + }, + { + name: 'script task (no expression) (Camunda Cloud 8.2)', + config: { version: '8.2' }, + moddleElement: createModdle(createProcess(` + + + + + + `)), + report: { + id: 'Task_1', + message: 'Element of type must have property ', + path: [ + 'extensionElements', + 'values', + 0, + 'expression' + ], + data: { + type: ERROR_TYPES.PROPERTY_REQUIRED, + node: 'zeebe:Script', + parentNode: 'Task_1', + requiredProperty: 'expression' + } + } + }, + { + name: 'script task (no script result variable) (Camunda Cloud 8.2)', + config: { version: '8.2' }, + moddleElement: createModdle(createProcess(` + + + + + + `)), + report: { + id: 'Task_1', + message: 'Element of type must have property ', + path: [ + 'extensionElements', + 'values', + 0, + 'resultVariable' + ], + data: { + type: ERROR_TYPES.PROPERTY_REQUIRED, + node: 'zeebe:Script', + parentNode: 'Task_1', + requiredProperty: 'resultVariable' + } + } + }, ]; -RuleTester.verify('called-decision-or-task-definition', rule, { +RuleTester.verify('implementation', rule, { valid, invalid }); \ No newline at end of file diff --git a/test/camunda-cloud/integration/camunda-cloud-1-0-called-decision-or-task-definition.bpmn b/test/camunda-cloud/integration/camunda-cloud-1-0-implementation-definition.bpmn similarity index 100% rename from test/camunda-cloud/integration/camunda-cloud-1-0-called-decision-or-task-definition.bpmn rename to test/camunda-cloud/integration/camunda-cloud-1-0-implementation-definition.bpmn diff --git a/test/camunda-cloud/integration/camunda-cloud-1-0-called-decision-or-task-definition-errors.bpmn b/test/camunda-cloud/integration/camunda-cloud-1-0-implementation-errors.bpmn similarity index 100% rename from test/camunda-cloud/integration/camunda-cloud-1-0-called-decision-or-task-definition-errors.bpmn rename to test/camunda-cloud/integration/camunda-cloud-1-0-implementation-errors.bpmn diff --git a/test/camunda-cloud/integration/camunda-cloud-1-1-called-decision-or-task-definition.bpmn b/test/camunda-cloud/integration/camunda-cloud-1-1-implementation-definition.bpmn similarity index 100% rename from test/camunda-cloud/integration/camunda-cloud-1-1-called-decision-or-task-definition.bpmn rename to test/camunda-cloud/integration/camunda-cloud-1-1-implementation-definition.bpmn diff --git a/test/camunda-cloud/integration/camunda-cloud-1-1-called-decision-or-task-definition-errors.bpmn b/test/camunda-cloud/integration/camunda-cloud-1-1-implementation-errors.bpmn similarity index 100% rename from test/camunda-cloud/integration/camunda-cloud-1-1-called-decision-or-task-definition-errors.bpmn rename to test/camunda-cloud/integration/camunda-cloud-1-1-implementation-errors.bpmn diff --git a/test/camunda-cloud/integration/camunda-cloud-1-2-called-decision-or-task-definition-errors.bpmn b/test/camunda-cloud/integration/camunda-cloud-1-2-implementation-errors.bpmn similarity index 100% rename from test/camunda-cloud/integration/camunda-cloud-1-2-called-decision-or-task-definition-errors.bpmn rename to test/camunda-cloud/integration/camunda-cloud-1-2-implementation-errors.bpmn diff --git a/test/camunda-cloud/integration/camunda-cloud-1-2-called-decision-or-task-definition.bpmn b/test/camunda-cloud/integration/camunda-cloud-1-2-implementation.bpmn similarity index 100% rename from test/camunda-cloud/integration/camunda-cloud-1-2-called-decision-or-task-definition.bpmn rename to test/camunda-cloud/integration/camunda-cloud-1-2-implementation.bpmn diff --git a/test/camunda-cloud/integration/camunda-cloud-1-3-called-decision-or-task-definition-errors.bpmn b/test/camunda-cloud/integration/camunda-cloud-1-3-implementation-errors.bpmn similarity index 100% rename from test/camunda-cloud/integration/camunda-cloud-1-3-called-decision-or-task-definition-errors.bpmn rename to test/camunda-cloud/integration/camunda-cloud-1-3-implementation-errors.bpmn diff --git a/test/camunda-cloud/integration/camunda-cloud-1-3-called-decision-or-task-definition.bpmn b/test/camunda-cloud/integration/camunda-cloud-1-3-implementation.bpmn similarity index 100% rename from test/camunda-cloud/integration/camunda-cloud-1-3-called-decision-or-task-definition.bpmn rename to test/camunda-cloud/integration/camunda-cloud-1-3-implementation.bpmn diff --git a/test/camunda-cloud/integration/camunda-cloud-8-0-called-decision-or-task-definition-errors.bpmn b/test/camunda-cloud/integration/camunda-cloud-8-0-implementation-errors.bpmn similarity index 100% rename from test/camunda-cloud/integration/camunda-cloud-8-0-called-decision-or-task-definition-errors.bpmn rename to test/camunda-cloud/integration/camunda-cloud-8-0-implementation-errors.bpmn diff --git a/test/camunda-cloud/integration/camunda-cloud-8-0-called-decision-or-task-definition.bpmn b/test/camunda-cloud/integration/camunda-cloud-8-0-implementation.bpmn similarity index 100% rename from test/camunda-cloud/integration/camunda-cloud-8-0-called-decision-or-task-definition.bpmn rename to test/camunda-cloud/integration/camunda-cloud-8-0-implementation.bpmn diff --git a/test/camunda-cloud/integration/camunda-cloud-8-1-called-decision-or-task-definition-errors.bpmn b/test/camunda-cloud/integration/camunda-cloud-8-1-implementation-errors.bpmn similarity index 100% rename from test/camunda-cloud/integration/camunda-cloud-8-1-called-decision-or-task-definition-errors.bpmn rename to test/camunda-cloud/integration/camunda-cloud-8-1-implementation-errors.bpmn diff --git a/test/camunda-cloud/integration/camunda-cloud-8-1-called-decision-or-task-definition.bpmn b/test/camunda-cloud/integration/camunda-cloud-8-1-implementation.bpmn similarity index 100% rename from test/camunda-cloud/integration/camunda-cloud-8-1-called-decision-or-task-definition.bpmn rename to test/camunda-cloud/integration/camunda-cloud-8-1-implementation.bpmn diff --git a/test/camunda-cloud/integration/camunda-cloud-8-2-called-decision-or-task-definition-errors.bpmn b/test/camunda-cloud/integration/camunda-cloud-8-2-implementation-errors.bpmn similarity index 100% rename from test/camunda-cloud/integration/camunda-cloud-8-2-called-decision-or-task-definition-errors.bpmn rename to test/camunda-cloud/integration/camunda-cloud-8-2-implementation-errors.bpmn diff --git a/test/camunda-cloud/integration/camunda-cloud-8-2-called-decision-or-task-definition.bpmn b/test/camunda-cloud/integration/camunda-cloud-8-2-implementation.bpmn similarity index 100% rename from test/camunda-cloud/integration/camunda-cloud-8-2-called-decision-or-task-definition.bpmn rename to test/camunda-cloud/integration/camunda-cloud-8-2-implementation.bpmn diff --git a/test/camunda-cloud/integration/called-decision-or-task-definition.spec.js b/test/camunda-cloud/integration/implementation.spec.js similarity index 72% rename from test/camunda-cloud/integration/called-decision-or-task-definition.spec.js rename to test/camunda-cloud/integration/implementation.spec.js index fc402470..b0e120ae 100644 --- a/test/camunda-cloud/integration/called-decision-or-task-definition.spec.js +++ b/test/camunda-cloud/integration/implementation.spec.js @@ -16,7 +16,7 @@ const versions = [ '8.2' ]; -describe('integration - called-decision-or-task-definition', function() { +describe('integration - implementation', function() { versions.forEach(function(version) { @@ -39,13 +39,13 @@ describe('integration - called-decision-or-task-definition', function() { it('should not have errors', async function() { // given - const { root } = await readModdle(`test/camunda-cloud/integration/camunda-cloud-${ version.replace('.', '-') }-called-decision-or-task-definition.bpmn`); + const { root } = await readModdle(`test/camunda-cloud/integration/camunda-cloud-${ version.replace('.', '-') }-implementation.bpmn`); // when const reports = await linter.lint(root); // then - expect(reports[ 'camunda-compat/called-decision-or-task-definition' ]).not.to.exist; + expect(reports[ 'camunda-compat/implementation' ]).not.to.exist; }); }); @@ -56,13 +56,13 @@ describe('integration - called-decision-or-task-definition', function() { it('should have errors', async function() { // given - const { root } = await readModdle(`test/camunda-cloud/integration/camunda-cloud-${ version.replace('.', '-') }-called-decision-or-task-definition-errors.bpmn`); + const { root } = await readModdle(`test/camunda-cloud/integration/camunda-cloud-${ version.replace('.', '-') }-implementation-errors.bpmn`); // when const reports = await linter.lint(root); // then - expect(reports[ 'camunda-compat/called-decision-or-task-definition' ]).to.exist; + expect(reports[ 'camunda-compat/implementation' ]).to.exist; }); }); diff --git a/test/config/configs.spec.js b/test/config/configs.spec.js index e54d725d..e42dc913 100644 --- a/test/config/configs.spec.js +++ b/test/config/configs.spec.js @@ -5,7 +5,7 @@ const { configs } = require('../..'); describe('configs', function() { it('camunda-cloud-1-0', expectRules(configs, 'camunda-cloud-1-0', { - 'called-decision-or-task-definition': [ 'error', { version: '1.0' } ], + 'implementation': [ 'error', { version: '1.0' } ], 'called-element': 'error', 'collapsed-subprocess': 'error', 'duplicate-task-headers': 'error', @@ -25,7 +25,7 @@ describe('configs', function() { it('camunda-cloud-1-1', expectRules(configs, 'camunda-cloud-1-1', { - 'called-decision-or-task-definition': [ 'error', { version: '1.1' } ], + 'implementation': [ 'error', { version: '1.1' } ], 'called-element': 'error', 'collapsed-subprocess': 'error', 'duplicate-task-headers': 'error', @@ -45,7 +45,7 @@ describe('configs', function() { it('camunda-cloud-1-2', expectRules(configs, 'camunda-cloud-1-2', { - 'called-decision-or-task-definition': [ 'error', { version: '1.2' } ], + 'implementation': [ 'error', { version: '1.2' } ], 'called-element': 'error', 'collapsed-subprocess': 'error', 'duplicate-task-headers': 'error', @@ -65,7 +65,7 @@ describe('configs', function() { it('camunda-cloud-1-3', expectRules(configs, 'camunda-cloud-1-3', { - 'called-decision-or-task-definition': [ 'error', { version: '1.3' } ], + 'implementation': [ 'error', { version: '1.3' } ], 'called-element': 'error', 'collapsed-subprocess': 'error', 'duplicate-task-headers': 'error', @@ -85,7 +85,7 @@ describe('configs', function() { it('camunda-cloud-8-0', expectRules(configs, 'camunda-cloud-8-0', { - 'called-decision-or-task-definition': [ 'error', { version: '8.0' } ], + 'implementation': [ 'error', { version: '8.0' } ], 'called-element': 'error', 'collapsed-subprocess': 'error', 'duplicate-task-headers': 'error', @@ -104,7 +104,7 @@ describe('configs', function() { it('camunda-cloud-8-1', expectRules(configs, 'camunda-cloud-8-1', { - 'called-decision-or-task-definition': [ 'error', { version: '8.1' } ], + 'implementation': [ 'error', { version: '8.1' } ], 'called-element': 'error', 'collapsed-subprocess': 'error', 'duplicate-task-headers': 'error', @@ -123,7 +123,7 @@ describe('configs', function() { it('camunda-cloud-8-2', expectRules(configs, 'camunda-cloud-8-2', { - 'called-decision-or-task-definition': [ 'error', { version: '8.2' } ], + 'implementation': [ 'error', { version: '8.2' } ], 'called-element': 'error', 'collapsed-subprocess': 'error', 'duplicate-task-headers': 'error',