if( executable != null && executable.getBatchExecutionRecords() != null ) {
for( BatchExecutionRecordImpl batch: executable.getBatchExecutionRecords() ) {
for( ExecutionRecordImpl run : batch.getRuns() ) {
for( ExecutionStageRecordImpl stage : run.getStages() ) {
log.info("Looking at stage: " + stage.getStage());
ServiceRecordImpl sr = stage.getServiceRecord();
if( sr != null ) {
log.info("Got old service name: " + sr.getServiceName() );
log.info("Got old service endpoint: " + sr.getEndpoint() );
log.info("Looking to patch in new service record... "+sr.getId());
if( sr.getServiceDescription() != null && sr.getId() <= 0 ) {
log.info("Got old service desc name: " + sr.getServiceDescription().getName() );
ServiceRecordImpl newSR = ServiceRecordImpl.createServiceRecordFromDescription(exp.getEntityID(), sr.getServiceDescription(), exp.getStartDate());
stage.setServiceRecord(newSR);
// FIXME Removed this for now - ep.updateExperiment(exp);
}
log.info("Got old service host: " + sr.getHost() );
// FIXME Go through and check parameters are consistent?