From 3adb960aac7d7a3a721dd446b36d7a4c9c3bcaae Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Wed, 3 Nov 2021 11:41:31 +0100 Subject: [PATCH] chore(import): don't monkey patch ID but use `attrs` utility --- lib/import/BpmnImporter.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/import/BpmnImporter.js b/lib/import/BpmnImporter.js index 13100b51..b0b38eb9 100644 --- a/lib/import/BpmnImporter.js +++ b/lib/import/BpmnImporter.js @@ -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); }