if (diagrams.size() == 0) {
BPMNPlane plane = BpmnDiFactory.eINSTANCE.createBPMNPlane();
plane.setBpmnElement(modelHandler.getOrCreateProcess(modelHandler.getInternalParticipant()));
BPMNDiagram d = BpmnDiFactory.eINSTANCE.createBPMNDiagram();
d.setPlane(plane);
modelHandler.getDefinitions().getDiagrams().add(d);
featureProvider.link(diagram, d);
}
// First: add all IDs to our ID mapping table
for (BPMNDiagram d : diagrams) {
TreeIterator<EObject> iter = d.eAllContents();
while (iter.hasNext()) {
ModelUtil.addID( iter.next() );
}
}
for (BPMNDiagram d : diagrams) {
featureProvider.link(diagram, d);
BPMNPlane plane = d.getPlane();
if (plane.getBpmnElement() == null) {
plane.setBpmnElement(modelHandler.getOrCreateProcess(modelHandler.getInternalParticipant()));
}
List<DiagramElement> ownedElement = plane.getPlaneElement();