chore(import): make root discovery future proof
Related to https://github.com/bpmn-io/bpmn-js/issues/1546
This commit is contained in:
parent
a09926c325
commit
bb59dd0b61
|
@ -77,10 +77,13 @@ export function importBpmnDiagram(diagram, definitions, bpmnDiagram) {
|
|||
|
||||
var mainDiagram = bpmnDiagram || definitions.diagrams[0];
|
||||
|
||||
var rootId = mainDiagram.plane.bpmnElement.id;
|
||||
|
||||
// we do need to account for different ways we create root elements
|
||||
// each nested imported <root> do have the `_plane` suffix, while
|
||||
// the root <root> is found under the business object ID
|
||||
canvas.setRootElement(
|
||||
canvas.findRoot(
|
||||
mainDiagram.plane.bpmnElement.id
|
||||
)
|
||||
canvas.findRoot(rootId + '_plane') || canvas.findRoot(rootId)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue