4

A particular situation has risen where I need a simple workflow in place that allows me to trigger the translation of content in bundles or singular and when the translation is returned it will automatically publish all pages and items related to the items translated. I also want to be able to send items for translation not attached to workflow as well. I am looking for the best approach in this case as this solution must be for SDL Web 8.5 and Translation Module V.12 My research led me to a blog post written by Eric Huiza at:

https://community.sdl.com/product-groups/sdl-tridion-dx/tridion-sites/tridion-developer/b/weblog/posts/sdl-tridion-workflow-translation-manager-integration

Eric's approach in SDL Tridion 2013 is based on the fact that Translation Manager doesn’t have an API that is compatible with the SDL Tridion Workflow API (Based on Core Services) for that reason he recommends to create a Translation Manager Façade by implementing a WCF service that acts as glue between SDL Tridion Workflow (Core Services) and Translation Manager (COM+). Ultimately, he creates Workflow Process Definition for push transactions.

Unfortunate for me, Eric's solution is for SDL Tridion 2013. I was expecting that in SDL Web 8.5, I could get around my problem without going through the WCF path.

I am looking for a standardized way (or best practice recommended by SDL company) to come up with a solution that satisfies the requirements of my task.

  • Search Triggering translations from Workflow in SDL docs and Download API reference documentation for Web 8.5. There you will get some Idea. – Manish Mehmood Apr 30 '18 at 17:34
7

I am sure Eric's solution will work with Web 8.5 as well. But I would not advise you to use Translation Manager Facade as service (and consume it in your workflow) because, with Web 8.5, the TMS is exposed by a web service itself that could be consumed directly in your Workflow Activity's code to interact with Translation Manager.

To send translation from the workflow, below needs to be done (At a High level):

  1. In visual studio open/create the Workflow Project where you define your External Activity Classes.
  2. Add the reference to the below dlls

%TRIDION_HOME%\bin\client\TranslationManager\Tridion.TranslationManager.V2.Data.dll

%TRIDION_HOME%\bin\client\TranslationManager\Tridion.TranslationManager.V2.TmService.Client.dll

  1. Use the SessionAwareTmServiceClient object to interact with the TMS.

    using (var tmsClient = new SessionAwareTmServiceClient("TmBinaryEndpoint")) { // Do Translation Manager process }

I have written a basic function to create a Translation Job as below, I haven't run it, changes might be needed accordingly:

private string Translate(string title, string publicationId, IEnumerable<string> items, bool includeItemsAlreadyTranslated)
        {
            using (var tmClient = new SessionAwareTmServiceClient("TmBinaryEndpoint"))
            {

                //TranslationJobData job = tmClient.CreateJobAsync(title, publicationId, TranslationJobType.PushJob);
                TranslationJobData job = tmClient.CreateJob(title, publicationId, TranslationJobType.PushJob);

                job.RequiredDate = DateTime.Now;

                job.Priority = TranslationJobPriority.High;

                foreach (string item in items)
                {
                    job.AddedItems.Add(new AddedItemData() { TcmUri= item });
                }

                job.IncludeItemsAlreadyTranslated = includeItemsAlreadyTranslated;
                job.State = TranslationJobState.ReadyForTranslation;
                tmClient.SaveJob(job);

                return job.Id.ToString();
            }
        }

I hope this helps.

3

In SDL Web 8.5, consider using the "Publish to Staging (Preview)" feature to automatically send items to translate on job sending and/or retrieval. The options are found in Publication properties for a system with Translation Manager configured.

0

You actually seem to be asking three different questions.

  1. Require workflow to trigger translation.

    1.1 As Saurabh notes above, you can now use the API provided and noted; whether you want to trigger from Workflow Activities directly or from the Event System

  2. Automatically publish all pages and items related to the items translated

    2.1 In 2013 you would detect the check-in of the translated items and if this was the user the service was configured to run as you could trigger the events you mention via your own implemented code; I'm not aware of anything different here without further testing

  3. Send items for translation not attached to workflow as well

    3.1 Tridion Workflow is not mandatory for sending for translation - but if you do have workflow it would seem a good opportunity to start the automation of it (We've worked with a client to utilise workflow and also fully automate translation, through World Server)

    3.2 Alternatively you can send translation jobs via specific Events (through the EVent System) or simply add specific items to a job and send manually.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.