modelMetaInfo.setId(model.getId());
modelMetaInfo.setModel(modelString);
modelService.addTransientModel(modelMetaInfo);
// this is a new model, we need to create an application
String newAppId = APPLICATION_PREFIX + model.getId();
IApplicationMetaInfo application = applicationService.getApplication(newAppId);
if (application == null) {
application = applicationService.getApplicationImpl(modelMetaInfo);
application.setName(model.getName());
application.setId(newAppId);
}
// assign the first configured UMI as default if application hasn't
// any others
if (application.getUmiSettings() == null) {
List<? extends ISettings> list = umiSettingsManager.getSettingsList();
if (!list.isEmpty()) {
application.setUmiSettings(list.get(0));
}
}
try {
application = applicationService.saveApplication(application);
} catch (DataModelException e) {