Verified Commit e35b6d44 authored by Alexandre Morin's avatar Alexandre Morin
Browse files

Added event on archive destruction request

parent a5eed9c8
......@@ -150,16 +150,23 @@ class ArchiveDestructionRequest extends abstractMessage
$this->generate($message);
$this->save($message);
}
$this->create($message);
$operationResult = true;
} catch (\Exception $e) {
$message->status = "error";
$this->create($message);
$operationResult = false;
throw $e;
}
$event = $this->lifeCycleJournalController->logEvent(
'medona/sending',
'medona/message',
$message->messageId,
$message,
$operationResult
);
$this->create($message);
$senderOrg = \laabs::getToken('ORGANIZATION');
// Requested by archiver: send auth request to originator
......@@ -216,6 +223,14 @@ class ArchiveDestructionRequest extends abstractMessage
$message->status = "accepted";
$event = $this->lifeCycleJournalController->logEvent(
'medona/acceptance',
'medona/message',
$message->messageId,
$message,
true
);
$this->sdoFactory->update($message);
}
......@@ -302,8 +317,10 @@ class ArchiveDestructionRequest extends abstractMessage
$message->status = "processed";
$message->operationDate = \laabs::newDatetime(null, "UTC");
$operationResult = true;
$this->update($message);
} catch (\Exception $e) {
$operationResult = false;
throw $e;
}
......@@ -311,6 +328,14 @@ class ArchiveDestructionRequest extends abstractMessage
$this->sdoFactory->commit();
}
$this->lifeCycleJournalController->logEvent(
'medona/processing',
'medona/message',
$message->messageId,
$message,
$operationResult
);
$archiveDestructionNotificationController = \laabs::newController("medona/ArchiveDestructionNotification");
// TO DO : Write destruction failures in comments
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment