DigitalObject dgoC = null;
wfResultItem.addLogInfo("STEP 4: Starting migration");
wfResultItem.addLogInfo("processingDigo.getPermanentUri(): " + processingDigo.getPermanentUri() +
", dgoB.getPermanentUri(): " + dgoB.getPermanentUri());
DataRegistry dataRegistry = DataRegistryFactory.getDataRegistry();
URI baseUri = DataRegistryFactory.createDataRegistryIdFromName(DOJCRConstants.REGISTRY_NAME);
wfResultItem.addLogInfo("base URI: " + baseUri);
URI resUri = URI.create(baseUri.toString() + dgoB.getPermanentUri().toString());
wfResultItem.addLogInfo("resUri: " + resUri);
URI dgoCRef = runMigration(migrate, resUri, true);
wfResultItem.addLogInfo("Completed migration. URI: " + dgoCRef);
// Add migration resulting text to metadata
if (dgoCRef != null) {
try {
baseUri = new PDURI(dgoCRef.normalize()).formDataRegistryRootURI();
wfResultItem.addLogInfo("migration base URI: " + baseUri);
dgoC = dataRegistry.getDigitalObjectManager(baseUri).retrieve(dgoCRef);
wfResultItem.addLogInfo("dgoC: " + dgoC.toString());
if (dgoC != null && dgoB.getPermanentUri() != null) {
Event eMigration = buildEvent(dgoB.getPermanentUri(), MIGRATE_EVENT);
dgoC = addEvent(dgoC, eMigration, null, true);
}