Dear Simon,
Thanks for your feedback!
Currently, the internals of Orthanc already feature a scheduler (class "ServerScheduler") that handles a queue of jobs (class "ServerJob"), each job consisting of a set of commands to be executed (interface "IServerCommand"). Almost all Lua scripts and REST commands (except for anonymization) already go through this scheduler, but the full refactoring is still WIP. A job can be internally canceled, and it is planned to expose this "job API" through REST. Also note that the scheduler is currently single-threaded (i.e. at most 1 command is executed at a given time).
However, when a job fails (which is the case as soon as 1 of its child commands fails), the job is simply dropped. It is not possible to restart it, contrarily to your request. I have added your idea to our roadmap:
https://trello.com/c/sB0hyTidThis task will most probably have to wait for the 1.0.0 release: My top-priority for the Orthanc core is currently to implement a query/retrieve client (more precisely, to expose C-MOVE SCU through REST).
So, to answer your question, I think that the most direct way to add a "replay" of interrupted transfers in Orthanc would be to develop a plugin. This plugin would manage a queue consisting of pairs (InstanceID, TargetModality). It would have a thread that would continuously monitor this queue, doing a "OrthancPluginRestApiPost()" for each DICOM instance to be sent on the URI "/modalities/.../store", and would monitor the status code of the function. In the case of an error, the pair would be added to a second "error" queue. The content of this error queue could be re-added to the primary queue by a newly introduced REST callback.
Sébastien-