process.getFlowElements().addAll(lane.getFlowNodeRefs());
for (FlowNode node : lane.getFlowNodeRefs()) {
if (node instanceof DataObject) {
ItemDefinition def = ((DataObject) node).getItemSubjectRef();
if (def != null) {
if (def.eResource() == null) {
((Definitions) process.eContainer()).getRootElements().add(0, ((DataObject) node).getItemSubjectRef());
}
Import imported = def.getImport();
if (imported != null && imported.eResource() == null) {
((Definitions) process.eContainer()).getImports().add(0, ((DataObject) node).getItemSubjectRef().getImport());