fix(copy-paste): wire DI of subprocesses correctly
This commit is contained in:
parent
c4cbc7821a
commit
9366700235
|
@ -145,6 +145,7 @@ export default function BpmnCopyPaste(bpmnFactory, eventBus, moddleCopy) {
|
|||
);
|
||||
|
||||
newDi = bpmnFactory.create(oldDi.$type);
|
||||
newDi.bpmnElement = newBusinessObject;
|
||||
|
||||
descriptor.di = moddleCopy.copyElement(
|
||||
oldDi,
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
));
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue