while (record != null) {
if (record.isDataExistent()) {
MigrationResult migrationResult = null;
try {
DigitalObject workflow = a.getExperiment().getWorkflow();
if (workflow != null) {
byte[] workflowData = byteStreamManager.load(workflow.getPid());
workflow.getData().setData(workflowData);
}
DigitalObject objectToMigrate = digitalObjectManager.getCopyOfDataFilledDigitalObject(record);
migrationResult = migrationAction.migrate(a, objectToMigrate);
} catch (StorageException e) {
log.error("Failed to load sample object", e);
} catch (NullPointerException e) {
log.error(
"Caught nullpointer exception when running a migration tool. ### WRONG CONFIGURATION? ###",
e);
} catch (Throwable t) {
log.error("Caught unchecked exception when running a migration tool: " + t.getMessage(), t);
}
// Set detailed info before moving data to storage
extractDetailedInfos(a, record, migrationResult);
if (migrationResult != null) {
try {
if (migrationResult.isSuccessful()) {
DigitalObject experimentResultObject = a.getExperiment().getResults().get(record);
experimentResultObject.assignValues(migrationResult.getMigratedObject());
digitalObjectManager.moveDataToStorage(experimentResultObject);
addCriteria(a, record, migrationResult);
}
} catch (StorageException e) {