// Transform form structures to objects for validations
Object newConfigurationObject = ClassUtils.instantiate(connector.getConnectionConfigurationClass());
FormUtils.fromForms(newConnection.getConnectorPart().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 connector,
// else the values will get set in the forms in the connector for
// each connection.
List<MForm> forms = newConnector.getJobForms(job.getType()).clone(false).getForms();
MJobForms newJobForms = new MJobForms(job.getType(), forms);
upgrader.upgrade(job.getConnectorPart(), newJobForms);
MJob newJob = new MJob(connectorID, job.getConnectionId(),
job.getType(), newJobForms, job.getFrameworkPart());
newJob.setPersistenceId(job.getPersistenceId());
// Transform form structures to objects for validations
Object newConfigurationObject = ClassUtils.instantiate(connector.getJobConfigurationClass(job.getType()));
FormUtils.fromForms(newJob.getConnectorPart().getForms(), newConfigurationObject);
Validation validation = validator.validateJob(newJob.getType(), newConfigurationObject);
if (validation.getStatus().canProceed()) {
updateJob(newJob, tx);
} else {
logInvalidModelObject("job", newJob, validation);
upgradeSuccessful = false;
}