Skip to content

Commit 11a8efe

Browse files
barmacnikku
authored andcommitted
fix: disallow output mapping for terminate event
Related to camunda/camunda-modeler#4096
1 parent 9920c91 commit 11a8efe

File tree

3 files changed

+38
-7
lines changed

3 files changed

+38
-7
lines changed

src/provider/zeebe/utils/InputOutputUtil.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ export function areInputParametersSupported(element) {
8080

8181
export function areOutputParametersSupported(element) {
8282

83-
if (is(element, 'bpmn:EndEvent') && getErrorEventDefinition(element)) {
83+
if (is(element, 'bpmn:EndEvent') && (
84+
getErrorEventDefinition(element) || getTerminateEventDefinition(element)
85+
)) {
8486
return false;
8587
}
8688

@@ -95,6 +97,10 @@ export function areOutputParametersSupported(element) {
9597
]);
9698
}
9799

100+
function getTerminateEventDefinition(element) {
101+
return getEventDefinition(element, 'bpmn:TerminateEventDefinition');
102+
}
103+
98104
export function createIOMapping(properties, parent, bpmnFactory) {
99105
return createElement('zeebe:IoMapping', properties, parent, bpmnFactory);
100106
}

test/spec/provider/zeebe/OutputProps.bpmn

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:zeebe="http://camunda.org/schema/zeebe/1.0" id="Definitions_1md541i" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.10.0">
2+
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:zeebe="http://camunda.org/schema/zeebe/1.0" id="Definitions_1md541i" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.20.0">
33
<bpmn:process id="Process_1" isExecutable="true">
44
<bpmn:serviceTask id="ServiceTask_1" name="ServiceTask_1">
55
<bpmn:extensionElements>
@@ -33,21 +33,28 @@
3333
</zeebe:ioMapping>
3434
</bpmn:extensionElements>
3535
</bpmn:serviceTask>
36+
<bpmn:endEvent id="TerminateEvent">
37+
<bpmn:terminateEventDefinition id="TerminateEventDefinition_0278au4" />
38+
</bpmn:endEvent>
3639
</bpmn:process>
3740
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
3841
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">
3942
<bpmndi:BPMNShape id="ServiceTask_0rud1s3_di" bpmnElement="ServiceTask_1">
4043
<dc:Bounds x="160" y="60" width="100" height="80" />
4144
<bpmndi:BPMNLabel />
4245
</bpmndi:BPMNShape>
43-
<bpmndi:BPMNShape id="Activity_1jxbsb5_di" bpmnElement="ServiceTask_2">
44-
<dc:Bounds x="280" y="60" width="100" height="80" />
46+
<bpmndi:BPMNShape id="Activity_0tyoei0_di" bpmnElement="Task_1">
47+
<dc:Bounds x="160" y="260" width="100" height="80" />
4548
<bpmndi:BPMNLabel />
4649
</bpmndi:BPMNShape>
4750
<bpmndi:BPMNShape id="Activity_10ckisu_di" bpmnElement="ServiceTask_NoExtensionElements">
4851
<dc:Bounds x="160" y="160" width="100" height="80" />
4952
<bpmndi:BPMNLabel />
5053
</bpmndi:BPMNShape>
54+
<bpmndi:BPMNShape id="Activity_1jxbsb5_di" bpmnElement="ServiceTask_2">
55+
<dc:Bounds x="280" y="60" width="100" height="80" />
56+
<bpmndi:BPMNLabel />
57+
</bpmndi:BPMNShape>
5158
<bpmndi:BPMNShape id="Activity_18i7pky_di" bpmnElement="ServiceTask_NoIoMapping">
5259
<dc:Bounds x="280" y="160" width="100" height="80" />
5360
<bpmndi:BPMNLabel />
@@ -56,9 +63,8 @@
5663
<dc:Bounds x="400" y="160" width="100" height="80" />
5764
<bpmndi:BPMNLabel />
5865
</bpmndi:BPMNShape>
59-
<bpmndi:BPMNShape id="Activity_0tyoei0_di" bpmnElement="Task_1">
60-
<dc:Bounds x="160" y="260" width="100" height="80" />
61-
<bpmndi:BPMNLabel />
66+
<bpmndi:BPMNShape id="Event_1mzhhj5_di" bpmnElement="TerminateEvent">
67+
<dc:Bounds x="362" y="382" width="36" height="36" />
6268
</bpmndi:BPMNShape>
6369
</bpmndi:BPMNPlane>
6470
</bpmndi:BPMNDiagram>

test/spec/provider/zeebe/OutputProps.spec.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,25 @@ describe('provider/zeebe - OutputProps', function() {
296296

297297
});
298298

299+
300+
describe('bpmn:EndEvent#output', function() {
301+
302+
it('should NOT display for terminate event', inject(async function(elementRegistry, selection) {
303+
304+
// given
305+
const task = elementRegistry.get('TerminateEvent');
306+
307+
await act(() => {
308+
selection.select(task);
309+
});
310+
311+
// when
312+
const outputGroup = getGroup(container, 'outputs');
313+
314+
// then
315+
expect(outputGroup).to.not.exist;
316+
}));
317+
});
299318
});
300319

301320

0 commit comments

Comments
 (0)