fix(copy-paste): wire DI of subprocesses correctly

This commit is contained in:
Martin Stamm 2022-01-18 11:58:38 +01:00 committed by fake-join[bot]
parent c4cbc7821a
commit 9366700235
2 changed files with 30 additions and 0 deletions

View File

@ -145,6 +145,7 @@ export default function BpmnCopyPaste(bpmnFactory, eventBus, moddleCopy) {
);
newDi = bpmnFactory.create(oldDi.$type);
newDi.bpmnElement = newBusinessObject;
descriptor.di = moddleCopy.copyElement(
oldDi,

View File

@ -463,6 +463,35 @@ describe('features/copy-paste', function() {
}
));
it('should wire DIs correctly', inject(
function(canvas, copyPaste, elementRegistry) {
// given
var subprcoess = elementRegistry.get('SubProcess_1'),
rootElement = canvas.getRootElement();
copyPaste.copy(subprcoess);
// when
var elements = copyPaste.paste({
element: rootElement,
point: {
x: 300,
y: 300
}
});
// then
var subprocess = elements[0];
var di = subprocess.di;
expect(di).to.exist;
expect(di.bpmnElement).to.exist;
expect(di.bpmnElement).to.equal(subprocess.businessObject);
}
));
});