Skip to content

Commit f10f8f9

Browse files
committed
fix: show variableEvents for conditional intermediate catch events
1 parent ececff9 commit f10f8f9

File tree

3 files changed

+34
-26
lines changed

3 files changed

+34
-26
lines changed

src/provider/zeebe/properties/EventConditionProps.js

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,7 @@ export function EventConditionProps(props) {
4444
return [];
4545
}
4646

47-
// `variableEvents` are not applicable for root-level events
48-
if (!is(element.parent, 'bpmn:SubProcess')) {
49-
return [
50-
{
51-
id: 'condition',
52-
component: Condition,
53-
isEdited: isFeelEntryEdited
54-
},
55-
{
56-
id: 'variableNames',
57-
component: VariableNames,
58-
},
59-
];
60-
}
61-
62-
return [
47+
const entries = [
6348
{
6449
id: 'condition',
6550
component: Condition,
@@ -69,11 +54,16 @@ export function EventConditionProps(props) {
6954
id: 'variableNames',
7055
component: VariableNames,
7156
},
72-
{
57+
];
58+
59+
if (is(element.parent, 'bpmn:SubProcess') || is(element, 'bpmn:IntermediateCatchEvent')) {
60+
entries.push({
7361
id: 'variableEvents',
7462
component: VariableEvents,
75-
}
76-
];
63+
});
64+
}
65+
66+
return entries;
7767
}
7868

7969
/**

test/spec/provider/zeebe/EventConditionProps.bpmn

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,13 @@
1616
<bpmn:condition xsi:type="bpmn:tFormalExpression">=foo &lt; bar</bpmn:condition>
1717
</bpmn:conditionalEventDefinition>
1818
</bpmn:startEvent>
19-
<bpmn:startEvent id="Event_3">
20-
<bpmn:conditionalEventDefinition id="ConditionalEventDefinition_16we37r">
21-
</bpmn:conditionalEventDefinition>
22-
</bpmn:startEvent>
19+
<bpmn:intermediateCatchEvent id="Event_3">
20+
<bpmn:conditionalEventDefinition id="ConditionalEventDefinition_02j8kp2" />
21+
</bpmn:intermediateCatchEvent>
2322
</bpmn:process>
2423
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
2524
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1dd1gi1">
26-
<bpmndi:BPMNShape id="BPMNShape_04nb8mn" bpmnElement="Event_3">
25+
<bpmndi:BPMNShape id="Event_1dwo39y_di" bpmnElement="Event_3">
2726
<dc:Bounds x="152" y="232" width="36" height="36" />
2827
</bpmndi:BPMNShape>
2928
<bpmndi:BPMNShape id="Activity_1q8hsrq_di" bpmnElement="Activity_01gjpl1" isExpanded="true">

test/spec/provider/zeebe/EventConditionProps.spec.js

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ describe('provider/zeebe - EventConditionProps', function() {
214214

215215
describe('zeebe:ConditionalFilter#variableEvents', function() {
216216

217-
it('should display', inject(async function(elementRegistry, selection) {
217+
it('should display inside subprocess', inject(async function(elementRegistry, selection) {
218218

219219
// given
220220
const element = elementRegistry.get('Event_2');
@@ -233,7 +233,26 @@ describe('provider/zeebe - EventConditionProps', function() {
233233
}));
234234

235235

236-
it('should not display on root level', inject(async function(elementRegistry, selection) {
236+
it('should display for intermediate catch event', inject(async function(elementRegistry, selection) {
237+
238+
// given
239+
const element = elementRegistry.get('Event_3');
240+
241+
// when
242+
await act(() => {
243+
selection.select(element);
244+
});
245+
246+
const createCheckbox = domQuery('input[name=variableEvents-create]', container);
247+
const updateCheckbox = domQuery('input[name=variableEvents-update]', container);
248+
249+
// then
250+
expect(createCheckbox).to.exist;
251+
expect(updateCheckbox).to.exist;
252+
}));
253+
254+
255+
it('should not display on process start event', inject(async function(elementRegistry, selection) {
237256

238257
// given
239258
const element = elementRegistry.get('Event_1');

0 commit comments

Comments
 (0)