diff --git a/rules/camunda-cloud/link-event.js b/rules/camunda-cloud/link-event.js index b58c859e..4235a7de 100644 --- a/rules/camunda-cloud/link-event.js +++ b/rules/camunda-cloud/link-event.js @@ -89,7 +89,7 @@ module.exports = skipInNonExecutableProcess(function() { // check for missing link catch & throw event names if (isLinkEvent(node)) { - const linkEventDefinition = getEventDefinition(node, 'bpmn:LinkEventDefinition'); + const linkEventDefinition = getEventDefinition(node); const errors = hasProperties(linkEventDefinition, { name: { @@ -109,15 +109,19 @@ module.exports = skipInNonExecutableProcess(function() { }); function isLinkEvent(element) { + const eventDefinition = getEventDefinition(element); + return isAny(element, [ 'bpmn:IntermediateCatchEvent', 'bpmn:IntermediateThrowEvent' - ]) && getEventDefinition(element, 'bpmn:LinkEventDefinition'); + ]) && eventDefinition && is(eventDefinition, 'bpmn:LinkEventDefinition'); } function isLinkCatchEvent(element) { + const eventDefinition = getEventDefinition(element); + return is(element, 'bpmn:IntermediateCatchEvent') - && getEventDefinition(element, 'bpmn:LinkEventDefinition'); + && eventDefinition && is(eventDefinition, 'bpmn:LinkEventDefinition'); } function getLinkCatchEvents(flowElementsContainer) { diff --git a/test/camunda-cloud/link-event.spec.js b/test/camunda-cloud/link-event.spec.js index 10d2599e..6b6c1b7b 100644 --- a/test/camunda-cloud/link-event.spec.js +++ b/test/camunda-cloud/link-event.spec.js @@ -11,6 +11,14 @@ const { const { ERROR_TYPES } = require('../../rules/utils/element'); const valid = [ + { + name: 'escalation event', + moddleElement: createModdle(createProcess(` + + + + `)) + }, { name: 'link catch events', moddleElement: createModdle(createProcess(`