From 48f45b88163635434b2af5f8487a42722bb9bb08 Mon Sep 17 00:00:00 2001 From: Martin Stamm Date: Mon, 21 Aug 2023 10:52:30 +0200 Subject: [PATCH] fix(zeebe): remove output group from error end events related to https://github.com/camunda/camunda-modeler/issues/3782 --- src/provider/zeebe/utils/InputOutputUtil.js | 13 ++++++++++-- .../zeebe/ZeebePropertiesProvider.bpmn | 11 +++++++++- .../zeebe/ZeebePropertiesProvider.spec.js | 21 ++++++++++++------- 3 files changed, 34 insertions(+), 11 deletions(-) diff --git a/src/provider/zeebe/utils/InputOutputUtil.js b/src/provider/zeebe/utils/InputOutputUtil.js index 5ce4ca609..921bfe0e0 100644 --- a/src/provider/zeebe/utils/InputOutputUtil.js +++ b/src/provider/zeebe/utils/InputOutputUtil.js @@ -3,7 +3,8 @@ import { } from 'bpmn-js/lib/features/modeling/util/ModelingUtil'; import { - getBusinessObject + getBusinessObject, + is } from 'bpmn-js/lib/util/ModelUtil'; import { @@ -15,7 +16,10 @@ import { } from '../../../utils/ElementUtil'; import { isZeebeServiceTask } from './ZeebeServiceTaskUtil'; -import { getEventDefinition } from '../../bpmn/utils/EventDefinitionUtil'; +import { + getErrorEventDefinition, + getEventDefinition +} from '../../bpmn/utils/EventDefinitionUtil'; function getElements(bo, type, prop) { const elems = getExtensionElementsList(bo, type); @@ -75,6 +79,11 @@ export function areInputParametersSupported(element) { } export function areOutputParametersSupported(element) { + + if (is(element, 'bpmn:EndEvent') && getErrorEventDefinition(element)) { + return false; + } + return isAny(element, [ 'zeebe:ZeebeServiceTask', 'bpmn:UserTask', diff --git a/test/spec/provider/zeebe/ZeebePropertiesProvider.bpmn b/test/spec/provider/zeebe/ZeebePropertiesProvider.bpmn index 1c17eaddc..672d0536f 100644 --- a/test/spec/provider/zeebe/ZeebePropertiesProvider.bpmn +++ b/test/spec/provider/zeebe/ZeebePropertiesProvider.bpmn @@ -1,5 +1,5 @@ - + @@ -111,6 +111,9 @@ + + + @@ -207,6 +210,12 @@ + + + + + + diff --git a/test/spec/provider/zeebe/ZeebePropertiesProvider.spec.js b/test/spec/provider/zeebe/ZeebePropertiesProvider.spec.js index 875099477..2c1a7f976 100644 --- a/test/spec/provider/zeebe/ZeebePropertiesProvider.spec.js +++ b/test/spec/provider/zeebe/ZeebePropertiesProvider.spec.js @@ -141,17 +141,22 @@ describe('', function() { it('should NOT show output group', inject(async function(elementRegistry, selection) { // given - const task = elementRegistry.get('Task_1'); + const elements = [ + elementRegistry.get('Task_1'), + elementRegistry.get('ErrorEndEvent_1') + ]; - await act(() => { - selection.select(task); - }); + for (const ele of elements) { + await act(() => { + selection.select(ele); + }); - // when - const outputGroup = getGroup(container, 'outputs'); + // when + const outputGroup = getGroup(container, 'outputs'); - // then - expect(outputGroup).to.not.exist; + // then + expect(outputGroup).to.not.exist; + } }));