diff --git a/lib/import/BpmnImporter.js b/lib/import/BpmnImporter.js index 23ad3308..029dd187 100644 --- a/lib/import/BpmnImporter.js +++ b/lib/import/BpmnImporter.js @@ -26,6 +26,13 @@ import { } from './Util'; +/** + * @param {ModdleElement} semantic + * @param {ModdleElement} di + * @param {Object} [attrs=null] + * + * @return {Object} + */ function elementData(semantic, di, attrs) { return assign({ id: semantic.id, @@ -105,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.addRootElement(element); }