fix(bpmn-replace): correctly replace sub process -> call activity
* when not morphing collapsed sub process with children into expanded sub process children must be removed Related to camunda/camunda-modeler#739
This commit is contained in:
parent
efaeeddf19
commit
ef52dff84c
|
@ -151,6 +151,13 @@ function BpmnReplace(bpmnFactory, replace, selection, modeling, eventBus) {
|
|||
}
|
||||
}
|
||||
|
||||
// remove children if not expanding sub process
|
||||
if (is(oldBusinessObject, 'bpmn:SubProcess')
|
||||
&& !isExpanded(oldBusinessObject)
|
||||
&& !is(newBusinessObject, 'bpmn:SubProcess')) {
|
||||
hints.moveChildren = false;
|
||||
}
|
||||
|
||||
// transform collapsed/expanded pools
|
||||
if (is(oldBusinessObject, 'bpmn:Participant')) {
|
||||
|
||||
|
|
|
@ -853,6 +853,25 @@ describe('features/replace - bpmn replace', function() {
|
|||
})
|
||||
);
|
||||
|
||||
|
||||
it('should remove children of collapsed sub process not morphing into expanded',
|
||||
inject(function(bpmnReplace, elementRegistry, modeling) {
|
||||
|
||||
// given
|
||||
var element = elementRegistry.get('SubProcess_1');
|
||||
var newElementData = {
|
||||
type: 'bpmn:CallActivity'
|
||||
};
|
||||
|
||||
modeling.toggleCollapse(element);
|
||||
|
||||
// when
|
||||
var newElement = bpmnReplace.replaceElement(element, newElementData);
|
||||
|
||||
// then
|
||||
expect(is(newElement, 'bpmn:CallActivity')).to.be.true;
|
||||
}));
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue