Skip to content

Commit

Permalink
feat: adjust missing execution listener type message
Browse files Browse the repository at this point in the history
  • Loading branch information
barmac committed Jul 30, 2024
1 parent cb0b893 commit 3014907
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/utils/error-messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,10 @@ function getPropertyRequiredErrorMessage(report, executionPlatform, executionPla
return `${ getIndefiniteArticle(typeString) } <${ typeString }> with <Implementation: Job worker> must have a defined <Task definition type>`;
}

if (is(node, 'zeebe:ExecutionListener') && requiredProperty === 'type') {
return 'An <Execution Listener> must have a defined <Type>';
}

if (requiredProperty === 'errorRef') {

if (parentNode && is(parentNode, 'bpmn:CatchEvent')) {
Expand Down
27 changes: 27 additions & 0 deletions test/spec/utils/error-messages.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1530,6 +1530,33 @@ describe('utils/error-messages', function() {
expect(errorMessage).to.equal('A <Link Intermediate Catch Event> must have a defined <Name>');
});


it('should adjust (execution listener type)', async function() {

// given
const node = createElement('bpmn:ServiceTask', {
extensionElements: createElement('bpmn:ExtensionElements', {
values: [
createElement('zeebe:ExecutionListeners', {
listeners: [
createElement('zeebe:ExecutionListener', { eventType: 'start', type: '' }),
]
})
]
})
});

const { default: rule } = await import('bpmnlint-plugin-camunda-compat/rules/camunda-cloud/execution-listener');

const report = await getLintError(node, rule);

// when
const errorMessage = getErrorMessage(report);

// then
expect(errorMessage).to.equal('An <Execution Listener> must have a defined <Type>');
});

});


Expand Down

0 comments on commit 3014907

Please sign in to comment.