chore(import): don't monkey patch ID but use `attrs` utility

This commit is contained in:
Nico Rehwaldt 2021-11-03 11:41:31 +01:00 committed by Martin Stamm
parent 3052ea71f5
commit 3adb960aac
1 changed files with 5 additions and 6 deletions

View File

@ -112,13 +112,12 @@ BpmnImporter.prototype.add = function(semantic, di, parentElement) {
// invisible root element (process, subprocess or collaboration)
if (is(di, 'bpmndi:BPMNPlane')) {
// add a virtual element (not being drawn)
element = this._elementFactory.createRoot(elementData(semantic, di));
var attrs = is(semantic, 'bpmn:SubProcess')
? { id: semantic.id + '_plane' }
: {};
// for subprocesses, the id is already defined on the collapsed shape
if (is(semantic, 'bpmn:SubProcess')) {
element.id = element.id + '_plane';
}
// add a virtual element (not being drawn)
element = this._elementFactory.createRoot(elementData(semantic, di, attrs));
this._canvas.createPlane(semantic.id, element);
}