diff --git a/rules/camunda-cloud/link-event.js b/rules/camunda-cloud/link-event.js index a7258bed..b58c859e 100644 --- a/rules/camunda-cloud/link-event.js +++ b/rules/camunda-cloud/link-event.js @@ -28,6 +28,11 @@ module.exports = skipInNonExecutableProcess(function() { const name = linkEventDefinition.get('name'); + names = [ + ...names, + name + ]; + if (!name) { return { duplicateNames, @@ -35,11 +40,6 @@ module.exports = skipInNonExecutableProcess(function() { }; } - names = [ - ...names, - name - ]; - if (names.indexOf(name) !== index && !duplicateNames.includes(name)) { duplicateNames = [ ...duplicateNames, diff --git a/test/camunda-cloud/link-event.spec.js b/test/camunda-cloud/link-event.spec.js index edfc2b35..10d2599e 100644 --- a/test/camunda-cloud/link-event.spec.js +++ b/test/camunda-cloud/link-event.spec.js @@ -175,6 +175,32 @@ const invalid = [ requiredProperty: 'name' }, } + }, + { + name: 'link catch events (missing name, no duplicate name)', + moddleElement: createModdle(createProcess(` + + + + + + + `)), + report: { + id: 'IntermediateCatchEvent_1', + message: 'Element of type must have property ', + path: [ + 'eventDefinitions', + 0, + 'name' + ], + data: { + type: ERROR_TYPES.PROPERTY_REQUIRED, + node: 'LinkEventDefinition_1', + parentNode: 'IntermediateCatchEvent_1', + requiredProperty: 'name' + }, + } } ];