Triggering translations from Workflow

A Workflow defines the movement of tasks through a work process. It ensures that activities are executed in a specific sequence and are performed by specific individuals or by the system. This section describes how to trigger translations from Workflow in Tridion Sites.

You can download the Translation Manager API from: API reference documentation downloads.

To work with the Translation Manager API from automatic C# workflow activities, use this code snippet to create a SessionAwareTmServiceClient object:
using (var tmClient = new SessionAwareTmServiceClient("TmBinaryEndpoint"))
{
    // [Do Translation Manager process]
}

Example of adding an Automatic Activity in Workflow Designer

Set Script Type to C# and enter code directly in the dialog, for example:
using (var tmClient = new SessionAwareTmServiceClient("TmBinaryEndpoint"))
{
  var job = tmClient.GetAllJobsOverview().FirstOrDefault();
  string jobName = job != null ? job.Title : "No job found";

  // Script for Automatic Activity Content Manager Workflow

  ActivityFinishData finishData = new ActivityFinishData(){ Message = "First job title is " + jobName };
  SessionAwareCoreServiceClient.FinishActivity(CurrentActivityInstance.Id, finishData, null);
}