Re-import Imported Package

In the GUI, if you attempt to import an previously imported return package, the user is prompted to confirm this is what they intend, and the package is then re-imported. Is the same functionality available via the SDK? The regular `.ImportReturnPackage` method on a FileBasedProject doesn't seem to provide any options, and indeed only throws an InvalidOperationException later with the stack trace below. Is there another approach to importing that can be taken?

Is it possible to recreate the functionality exposed in the GUI via the SDK?

Stack Trace:
This property is only available once the package has been imported.
   at Sdl.ProjectApi.Implementation.PackageOperation.get_Files()
   at Sdl.ProjectAutomation.FileBased.FileBasedProject.CreateReturnPackageImportObject(IReturnPackageImport rpi)
   at Sdl.ProjectAutomation.FileBased.FileBasedProject.ImportReturnPackage(String returnPackageFilePath, EventHandler`1 statusEventHandler, EventHandler`1 messageEventHandler)
   at Sdl.ProjectAutomation.FileBased.FileBasedProject.ImportReturnPackage(String returnPackageFilePath)

Parents Reply
  • I have an additional question and it seems like this topic ist the right place for it [:)]

    Our main scenario is that we are sending an sdlppx package to a translator. The translator translates the package, generates a sdlrpx package and sends it back to us (via web upload). Behind the upload form there is an automated import process, which imports the sdlrpx package into the project (sdlproj). For the first upload, the import works fine.

    After the import, we have several quality assurance processes (automatic and / or manual). At this point, we make a decision whether the quality of the delivery is OK or not. If the quality is too bad, the delivery will be rejected and the translator will be informed to correct the delivery. Then, he needs to send a new sdlrpx package (there is no new sdlppx generated on our side when the delivery is rejected).

    When the translators uploads the corrected sdlrpx and we do the import again via SDK, the import fails because there has already been a previous import.

    So what do we need to do, so that the second delivery (or any later delivery) will be processed successfully?

    • Do we need to generate a new sdlppx package for the translator when we send the job back to him?
    • Do we need to reset anything inside the project (e.g. paragraph states, ...) before importing, or even before packing the sdlppx?
    • Is there anything else?

Children