Skip to content

Commit

Permalink
fix: adjusted the zeebe:userTask required message
Browse files Browse the repository at this point in the history
Related to #4690
  • Loading branch information
Skaiir committed Dec 11, 2024
1 parent 024b138 commit ba011a4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/utils/error-messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -347,7 +347,7 @@ function getExtensionElementNotAllowedErrorMessage(report, executionPlatform, ex
return message;
}

function getExtensionElementRequiredErrorMessage(report) {
function getExtensionElementRequiredErrorMessage(report, executionPlatform, executionPlatformVersion) {
const {
data,
message
Expand Down Expand Up @@ -390,7 +390,7 @@ function getExtensionElementRequiredErrorMessage(report) {
}

if (requiredExtensionElement === 'zeebe:UserTask') {
return `${ getIndefiniteArticle(typeString) } <${ typeString }> must have <Implementation: Zeebe user task>`;
return `${ getIndefiniteArticle(typeString) } <${ typeString }> with <Implementation: Job worker> is deprecated on ${ getExecutionPlatformLabel(executionPlatform, executionPlatformVersion) }. Consider migrating to <Implementation: Zeebe user task>.`;
}

return message;
Expand Down
26 changes: 26 additions & 0 deletions test/spec/utils/error-messages.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,32 @@ describe('utils/error-messages', function() {
// then
expect(errorMessage).to.equal('A <User Task> should have a defined <Form>');
});


it('should adjust (zeebe:UserTask)', async function() {

// given
const executionPlatformVersion = '8.6';

const node = createElement('bpmn:UserTask', {
extensionElements: createElement('bpmn:ExtensionElements', {
values: [
createElement('zeebe: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 User Task with <Implementation: Job worker> is deprecated on Camunda 8.6. Consider migrating to <Implementation: Zeebe user task>.');
});

});


Expand Down

0 comments on commit ba011a4

Please sign in to comment.