Skip to content

Commit 3599456

Browse files
committed
fix: remove default start event for ad-hoc subprocess
Related to camunda/camunda-modeler#4858
1 parent 102f21d commit 3599456

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

lib/features/modeling/behavior/SubProcessStartEventBehavior.js

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export default function SubProcessStartEventBehavior(injector, modeling) {
2626

2727
if (
2828
!is(newShape, 'bpmn:SubProcess') ||
29+
is(newShape,'bpmn:AdHocSubProcess') ||
2930
! (is(oldShape, 'bpmn:Task') || is(oldShape, 'bpmn:CallActivity')) ||
3031
!isExpanded(newShape)
3132
) {

test/spec/features/modeling/behavior/SubProcessStartEventBehaviorSpec.js

+24
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,30 @@ describe('features/modeling/behavior - subprocess start event', function() {
7474
});
7575

7676

77+
describe('task -> adhoc subprocess', function() {
78+
79+
it('should NOT add start event child to adhoc subprocess', inject(
80+
function(elementRegistry, bpmnReplace) {
81+
82+
// given
83+
var task = elementRegistry.get('Task_1'),
84+
collapsedSubProcess,
85+
startEvents;
86+
87+
// when
88+
collapsedSubProcess = bpmnReplace.replaceElement(task, {
89+
type: 'bpmn:AdHocSubProcess',
90+
isExpanded: true
91+
});
92+
93+
// then
94+
startEvents = getChildStartEvents(collapsedSubProcess);
95+
96+
expect(startEvents).to.have.length(0);
97+
}));
98+
});
99+
100+
77101
describe('task -> collapsed subprocess', function() {
78102

79103
it('should NOT add start event child to subprocess', inject(

0 commit comments

Comments
 (0)