final ModifiableModuleModel obtainedModuleModel =
moduleModel != null ? moduleModel : ModuleManager.getInstance(project).getModifiableModel();
for (ImportedOtpApp importedOtpApp : mySelectedOtpApps) {
VirtualFile ideaModuleDir = importedOtpApp.getRoot();
String ideaModuleFile = ideaModuleDir.getCanonicalPath() + File.separator + importedOtpApp.getName() + ".iml";
Module module = obtainedModuleModel.newModule(ideaModuleFile, ErlangModuleType.getInstance().getId());
createdModules.add(module);
importedOtpApp.setModule(module);
if (importedOtpApp.getIdeaModuleFile() == null) {
ModifiableRootModel rootModel = ModuleRootManager.getInstance(module).getModifiableModel();
// Make it inherit SDK from the project.