// Transform form structures to objects for validations
Object newConfigurationObject = ClassUtils.instantiate(FrameworkManager.getInstance().getConnectionConfigurationClass());
FormUtils.fromForms(newConnection.getFrameworkPart().getForms(), newConfigurationObject);
Validation validation = validator.validateConnection(newConfigurationObject);
if (validation.getStatus().canProceed()) {
updateConnection(newConnection, tx);
} else {
logInvalidModelObject("connection", newConnection, validation);
upgradeSuccessful = false;
}
}
for (MJob job : jobs) {
// Make a new copy of the forms from the framework,
// else the values will get set in the forms in the connector for
// each connection.
List<MForm> forms = framework.getJobForms(job.getType()).clone(false).getForms();
MJobForms newJobForms = new MJobForms(job.getType(), forms);
upgrader.upgrade(job.getFrameworkPart(), newJobForms);
MJob newJob = new MJob(job.getConnectorId(), job.getConnectionId(),
job.getType(), job.getConnectorPart(), newJobForms);
newJob.setPersistenceId(job.getPersistenceId());
// Transform form structures to objects for validations
Object newConfigurationObject = ClassUtils.instantiate(FrameworkManager.getInstance().getJobConfigurationClass(job.getType()));
FormUtils.fromForms(newJob.getFrameworkPart().getForms(), newConfigurationObject);
Validation validation = validator.validateJob(newJob.getType(), newConfigurationObject);
if (validation.getStatus().canProceed()) {
updateJob(newJob, tx);
} else {
logInvalidModelObject("job", newJob, validation);
upgradeSuccessful = false;
}