diff --git a/lib/compiled-config.js b/lib/compiled-config.js index 5b50637..d4f2d91 100644 --- a/lib/compiled-config.js +++ b/lib/compiled-config.js @@ -64,6 +64,7 @@ const rules = { "camunda-compat/no-zeebe-properties": "error", "camunda-compat/no-zeebe-user-task": "error", "camunda-compat/priority-definition": "error", + "camunda-compat/zeebe-user-task": "warn", "camunda-compat/secrets": "warn", "camunda-compat/sequence-flow-condition": "error", "camunda-compat/signal-reference": "error", @@ -231,50 +232,54 @@ import rule_34 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/priority cache['bpmnlint-plugin-camunda-compat/priority-definition'] = rule_34; -import rule_35 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/secrets'; +import rule_35 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/zeebe-user-task'; -cache['bpmnlint-plugin-camunda-compat/secrets'] = rule_35; +cache['bpmnlint-plugin-camunda-compat/zeebe-user-task'] = rule_35; -import rule_36 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/sequence-flow-condition'; +import rule_36 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/secrets'; -cache['bpmnlint-plugin-camunda-compat/sequence-flow-condition'] = rule_36; +cache['bpmnlint-plugin-camunda-compat/secrets'] = rule_36; -import rule_37 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/signal-reference'; +import rule_37 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/sequence-flow-condition'; -cache['bpmnlint-plugin-camunda-compat/signal-reference'] = rule_37; +cache['bpmnlint-plugin-camunda-compat/sequence-flow-condition'] = rule_37; -import rule_38 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/start-event-form'; +import rule_38 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/signal-reference'; -cache['bpmnlint-plugin-camunda-compat/start-event-form'] = rule_38; +cache['bpmnlint-plugin-camunda-compat/signal-reference'] = rule_38; -import rule_39 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/subscription'; +import rule_39 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/start-event-form'; -cache['bpmnlint-plugin-camunda-compat/subscription'] = rule_39; +cache['bpmnlint-plugin-camunda-compat/start-event-form'] = rule_39; -import rule_40 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/task-listener'; +import rule_40 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/subscription'; -cache['bpmnlint-plugin-camunda-compat/task-listener'] = rule_40; +cache['bpmnlint-plugin-camunda-compat/subscription'] = rule_40; -import rule_41 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/task-schedule'; +import rule_41 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/task-listener'; -cache['bpmnlint-plugin-camunda-compat/task-schedule'] = rule_41; +cache['bpmnlint-plugin-camunda-compat/task-listener'] = rule_41; -import rule_42 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/timer'; +import rule_42 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/task-schedule'; -cache['bpmnlint-plugin-camunda-compat/timer'] = rule_42; +cache['bpmnlint-plugin-camunda-compat/task-schedule'] = rule_42; -import rule_43 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/user-task-definition'; +import rule_43 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/timer'; -cache['bpmnlint-plugin-camunda-compat/user-task-definition'] = rule_43; +cache['bpmnlint-plugin-camunda-compat/timer'] = rule_43; -import rule_44 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/user-task-form'; +import rule_44 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/user-task-definition'; -cache['bpmnlint-plugin-camunda-compat/user-task-form'] = rule_44; +cache['bpmnlint-plugin-camunda-compat/user-task-definition'] = rule_44; -import rule_45 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/version-tag'; +import rule_45 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/user-task-form'; -cache['bpmnlint-plugin-camunda-compat/version-tag'] = rule_45; +cache['bpmnlint-plugin-camunda-compat/user-task-form'] = rule_45; -import rule_46 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/wait-for-completion'; +import rule_46 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/version-tag'; -cache['bpmnlint-plugin-camunda-compat/wait-for-completion'] = rule_46; \ No newline at end of file +cache['bpmnlint-plugin-camunda-compat/version-tag'] = rule_46; + +import rule_47 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/wait-for-completion'; + +cache['bpmnlint-plugin-camunda-compat/wait-for-completion'] = rule_47; \ No newline at end of file diff --git a/lib/utils/documentation.js b/lib/utils/documentation.js index 96c0ff9..31a7e90 100644 --- a/lib/utils/documentation.js +++ b/lib/utils/documentation.js @@ -1,4 +1,5 @@ const baseUrl = 'https://docs.camunda.io/docs/next/components/modeler/reference/modeling-guidance/rules'; +const userTaskMigrationUrl = 'https://docs.camunda.io/docs/next/apis-tools/migration-manuals/migrate-to-zeebe-user-tasks'; export function getDocumentationUrl(rule) { if (rule === 'camunda-compat/called-element') { @@ -29,6 +30,10 @@ export function getDocumentationUrl(rule) { return getUrl('history-time-to-live'); } + if (rule === 'camunda-compat/zeebe-user-task') { + return userTaskMigrationUrl; + } + return null; } diff --git a/lib/utils/error-messages.js b/lib/utils/error-messages.js index bab30e6..be4e595 100644 --- a/lib/utils/error-messages.js +++ b/lib/utils/error-messages.js @@ -102,7 +102,7 @@ export function getErrorMessage(report, executionPlatform, executionPlatformVers } if (type === ERROR_TYPES.EXTENSION_ELEMENT_REQUIRED) { - return getExtensionElementRequiredErrorMessage(report); + return getExtensionElementRequiredErrorMessage(report, executionPlatform, executionPlatformVersion); } if (type === ERROR_TYPES.PROPERTY_DEPENDENT_REQUIRED) { @@ -347,7 +347,7 @@ function getExtensionElementNotAllowedErrorMessage(report, executionPlatform, ex return message; } -function getExtensionElementRequiredErrorMessage(report) { +function getExtensionElementRequiredErrorMessage(report, executionPlatform, executionPlatformVersion) { const { data, message @@ -390,7 +390,7 @@ function getExtensionElementRequiredErrorMessage(report) { } if (requiredExtensionElement === 'zeebe:UserTask') { - return `${ getIndefiniteArticle(typeString) } <${ typeString }> must have `; + return `${ getIndefiniteArticle(typeString) } <${ typeString }> with is deprecated on ${ getExecutionPlatformLabel(executionPlatform, executionPlatformVersion) }. Consider migrating to .`; } return message; diff --git a/package-lock.json b/package-lock.json index 98d3175..7b5c363 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@bpmn-io/diagram-js-ui": "^0.2.3", "bpmn-moddle": "^9.0.1", "bpmnlint": "^10.3.1", - "bpmnlint-plugin-camunda-compat": "^2.28.1", + "bpmnlint-plugin-camunda-compat": "^2.29.0", "bpmnlint-utils": "^1.0.2", "camunda-bpmn-moddle": "^7.0.1", "clsx": "^2.0.0", @@ -1712,9 +1712,9 @@ } }, "node_modules/bpmnlint-plugin-camunda-compat": { - "version": "2.28.1", - "resolved": "https://registry.npmjs.org/bpmnlint-plugin-camunda-compat/-/bpmnlint-plugin-camunda-compat-2.28.1.tgz", - "integrity": "sha512-HBs5mqru2txC11g8wJALYd1xAbB24BL1LiXZyWWfWtdhh467FfELmibHZ0U+MUwv1QX2lACMQfVqb/A8HFV9wA==", + "version": "2.29.0", + "resolved": "https://registry.npmjs.org/bpmnlint-plugin-camunda-compat/-/bpmnlint-plugin-camunda-compat-2.29.0.tgz", + "integrity": "sha512-kSvdxAWWY8PV71IXqNqDTkYFmsTjSKFsN296cWk7HdM1Iyv+jYSli4nW0nOXtrVj6ZLfH1jfdDYJmv6n3NfXTQ==", "license": "MIT", "dependencies": { "@bpmn-io/feel-lint": "^1.2.0", @@ -8703,9 +8703,9 @@ } }, "bpmnlint-plugin-camunda-compat": { - "version": "2.28.1", - "resolved": "https://registry.npmjs.org/bpmnlint-plugin-camunda-compat/-/bpmnlint-plugin-camunda-compat-2.28.1.tgz", - "integrity": "sha512-HBs5mqru2txC11g8wJALYd1xAbB24BL1LiXZyWWfWtdhh467FfELmibHZ0U+MUwv1QX2lACMQfVqb/A8HFV9wA==", + "version": "2.29.0", + "resolved": "https://registry.npmjs.org/bpmnlint-plugin-camunda-compat/-/bpmnlint-plugin-camunda-compat-2.29.0.tgz", + "integrity": "sha512-kSvdxAWWY8PV71IXqNqDTkYFmsTjSKFsN296cWk7HdM1Iyv+jYSli4nW0nOXtrVj6ZLfH1jfdDYJmv6n3NfXTQ==", "requires": { "@bpmn-io/feel-lint": "^1.2.0", "@bpmn-io/moddle-utils": "^0.2.1", diff --git a/package.json b/package.json index 9587d1c..a3754f0 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "@bpmn-io/diagram-js-ui": "^0.2.3", "bpmn-moddle": "^9.0.1", "bpmnlint": "^10.3.1", - "bpmnlint-plugin-camunda-compat": "^2.28.1", + "bpmnlint-plugin-camunda-compat": "^2.29.0", "bpmnlint-utils": "^1.0.2", "camunda-bpmn-moddle": "^7.0.1", "clsx": "^2.0.0", diff --git a/test/spec/utils/error-messages.spec.js b/test/spec/utils/error-messages.spec.js index cfa42df..1d1bb32 100644 --- a/test/spec/utils/error-messages.spec.js +++ b/test/spec/utils/error-messages.spec.js @@ -678,6 +678,26 @@ describe('utils/error-messages', function() { // then expect(errorMessage).to.equal('A should have a defined
'); }); + + + it('should adjust (zeebe:UserTask)', async function() { + + // given + const executionPlatformVersion = '8.6'; + + const node = createElement('bpmn:UserTask'); + + const { default: rule } = await import('bpmnlint-plugin-camunda-compat/rules/camunda-cloud/zeebe-user-task'); + + const report = await getLintError(node, rule); + + // when + const errorMessage = getErrorMessage(report, 'Camunda Cloud', executionPlatformVersion); + + // then + expect(errorMessage).to.equal('A with is deprecated on Camunda 8.6. Consider migrating to .'); + }); + });