4

I have a very frustrating issue with SDL right now and Translation Manager jobs. Essentially what I need to do is capture the moment (within the context of translation job progress updating) an item is returned from World Server back to the CMS.

Translation jobs have a percentage complete as items get translated. So when FR finishes but DE is still being translated, the FR content is returned and the localized component updated. I want to capture via the event system when this happens and I need to publish that content immediately. I have this whole concept working when the entire job completes but not per complete translations in the job. I have tried to use this handler to achieve this:

EventSystem.Subscribe<ITranslationJob, IItemRetrieveEventArgs>(OnJobItemRecieved, EventPhases.Initiated, EventSubscriptionOrder.Normal);

But this event never fires at any point. I also have the following event handlers registered:

EventSystem.Subscribe<ITranslationJob, SaveEventArgs>(OnSaveTranslationJob, EventPhases.TransactionCommitted, EventSubscriptionOrder.Late);
            EventSystem.Subscribe<ITranslationJob, ITranslationJobStateChangeEventArgs>(OnJobStateChanged, EventPhases.TransactionCommitted, EventSubscriptionOrder.Late);
            EventSystem.Subscribe<ITranslationJob, ITranslationJobDeleteEventArgs>(OnDeleteTranslationJob, EventPhases.TransactionCommitted, EventSubscriptionOrder.Late);

All of the above events fire and execute the code as expected when I expect. But the handler for IItemRetrieveEventArgs never does. I have stripped all my code out and simply changed the handler method to log out details like so:

private void OnJobItemRecieved(ITranslationJob subject, IItemRetrieveEventArgs e, EventPhases phase) { logger.Debug("Item Data Recieved:" + e.RetrieveReason + " - " + e.Content.ToString()); }

But still nothing. I have checked that logging out, permission etc. all work and they do. All my debug code in the other handlers works fine. It is only the IItemRetrieveEventArgs that isn't doing a damn thing. I am not even sure if what I want to do is possible or what the event is even supposed to do as documentation is scarce on its use cases.

I have tried partially completed jobs, fully completed jobs and never does the IItemRetrieveEventArgs ever fire.

Essentially I am stuck and have no way forward to figure out why this event never fires or what to use instead.

I am using Translation Manager 8.2 API on SDL WEB 8.5 with the Tridion.TranslationManager.V2.EventSystem.Events.

Any help on this would be greatly appreciated.

Thanks,

  • I assume your publishing to live(?) or the "Publish to Preview" settings on a publication don't give you what you need - on a target publication you can publish on retrieve. – Neil Oct 2 '18 at 6:50
  • Out of interest, does it work if your use EventSubscriptionOrder.Early? Perhaps something else has swallowed the event but it can get to yours. – Neil Oct 2 '18 at 6:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.