Skip to content

Commit f145dd4

Browse files
committed
feat: hide <bpmn:CallActivity> Output group if zeebe:propagateAllChildVariables is true
Related to camunda/camunda-modeler#5402
1 parent 8a5e0ca commit f145dd4

File tree

3 files changed

+67
-2
lines changed

3 files changed

+67
-2
lines changed

src/provider/zeebe/utils/InputOutputUtil.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import {
2121
getEventDefinition
2222
} from '../../bpmn/utils/EventDefinitionUtil';
2323

24+
import { isPropagateAllChildVariables } from '../properties/OutputPropagationProps';
25+
2426
function getElements(bo, type, prop) {
2527
const elems = getExtensionElementsList(bo, type);
2628
return !prop ? elems : (elems[0] || {})[prop] || [];
@@ -86,12 +88,15 @@ export function areOutputParametersSupported(element) {
8688
return false;
8789
}
8890

91+
if (is(element, 'bpmn:CallActivity')) {
92+
return !isPropagateAllChildVariables(element);
93+
}
94+
8995
return isAny(element, [
9096
'zeebe:ZeebeServiceTask',
9197
'bpmn:UserTask',
9298
'bpmn:SubProcess',
9399
'bpmn:ReceiveTask',
94-
'bpmn:CallActivity',
95100
'bpmn:Event',
96101
'bpmn:BusinessRuleTask'
97102
]);

test/spec/provider/zeebe/OutputProps.bpmn

Lines changed: 10 additions & 1 deletion
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.20.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.41.0">
33
<bpmn:process id="Process_1" isExecutable="true">
44
<bpmn:serviceTask id="ServiceTask_1" name="ServiceTask_1">
55
<bpmn:extensionElements>
@@ -36,6 +36,11 @@
3636
<bpmn:endEvent id="TerminateEvent">
3737
<bpmn:terminateEventDefinition id="TerminateEventDefinition_0278au4" />
3838
</bpmn:endEvent>
39+
<bpmn:callActivity id="CallActivity_1" name="CallActivity_1">
40+
<bpmn:extensionElements>
41+
<zeebe:calledElement propagateAllChildVariables="false" />
42+
</bpmn:extensionElements>
43+
</bpmn:callActivity>
3944
</bpmn:process>
4045
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
4146
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">
@@ -66,6 +71,10 @@
6671
<bpmndi:BPMNShape id="Event_1mzhhj5_di" bpmnElement="TerminateEvent">
6772
<dc:Bounds x="362" y="382" width="36" height="36" />
6873
</bpmndi:BPMNShape>
74+
<bpmndi:BPMNShape id="Activity_0cpmy7k_di" bpmnElement="CallActivity_1">
75+
<dc:Bounds x="280" y="260" width="100" height="80" />
76+
<bpmndi:BPMNLabel />
77+
</bpmndi:BPMNShape>
6978
</bpmndi:BPMNPlane>
7079
</bpmndi:BPMNDiagram>
7180
</bpmn:definitions>

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

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,57 @@ describe('provider/zeebe - OutputProps', function() {
315315
expect(outputGroup).to.not.exist;
316316
}));
317317
});
318+
319+
320+
describe('bpmn:CallActivity#output', function() {
321+
322+
it('should display if `propagateAllChildVariables` is false',
323+
inject(async function(elementRegistry, selection) {
324+
325+
// given
326+
const callActivity = elementRegistry.get('CallActivity_1');
327+
328+
// when
329+
await act(() => {
330+
selection.select(callActivity);
331+
});
332+
333+
// then
334+
const outputGroup = getGroup(container, 'outputs');
335+
expect(outputGroup).to.exist;
336+
})
337+
);
338+
339+
340+
it('should not display if `propagateAllChildVariables` is true',
341+
inject(async function(elementRegistry, selection) {
342+
343+
// given
344+
const callActivity = elementRegistry.get('CallActivity_1');
345+
346+
// when
347+
await act(() => {
348+
selection.select(callActivity);
349+
});
350+
351+
const outputPropagationGroup = getGroup(container, 'outputPropagation');
352+
const outputPropagationGroupHeader = domQuery('.bio-properties-panel-group-header', outputPropagationGroup);
353+
354+
await act(() => {
355+
outputPropagationGroupHeader.click();
356+
});
357+
358+
const propagateAllChildVariablesToggle = domQuery('#bio-properties-panel-propagateAllChildVariables', container);
359+
await act(() => {
360+
propagateAllChildVariablesToggle.click();
361+
});
362+
363+
// then
364+
const outputGroup = getGroup(container, 'outputs');
365+
expect(outputGroup).to.not.exist;
366+
})
367+
);
368+
});
318369
});
319370

320371

0 commit comments

Comments
 (0)