IBackgroundTaskHandler - CreateTranslationFromReport
Creates the translations in the specified target languages starting from the specified object (Publicaton, Map, Topic, etc.). Calculates the source language objects for which the translation should be created based on the starting object.
Input data
The input data XML specifies...
- How to get to the starting object to calculate the objects to be translated.
- The target languages should be selected by the user.
- The source languages can be selected by the user. If source languages are not provided, they are calculated by taking all possible source languages from the XML Translation Settings.
- data
-
Input data root element.
- Required: yes
- targetlanguages
-
Element containing a comma-space separated list with target languages which are selected by the user
- Required: no
- requestedlanguages
-
Element indicating whether the requested languages of the current object must be merged with the supplied target languages
- Required: yes
- Allowed values: true/false
- inheritedlanguages
-
Element indicating whether the requested (and inherited) languages of the maps or topics referencing the current object must be merged with the supplied target languages
- Required: yes
- Allowed values: true/false
- ishtype
-
Element indicating the type of the starting object (ISHMasterDoc for a map, ISHIllustration for an illustration, also ISHModule, ISHTemplate and ISHLibrary).
- Required: yes
- logicalid
-
The logical id of the starting object to calculate the objects to be translated.
- Required: yes
- version
-
The version of the starting object to calculate the objects to be translated.
- Required: yes
- languages
-
Source languages to be used when calculating the objects to be translated. If languages are not provided, they are calculated by taking all possible source languages from the XML Translation Settings.
- Required: no
- resolutions
-
Resolutions to be used when calculating the objects to be translated. Used only when the starting object is a publication (ishtype is 'ISHPublication').
- Required: no
- ishfields
-
A Metadata xml structure to specify extra fields which will be set when creating new target language objects.
- Required: no
Input data example
This example shows typical event input data for this background task:<data>
<targetlanguages>en, fr, de, es, is, it, ja, nl</targetlanguages>
<requestedlanguages>false</requestedlanguages>
<inheritedlanguages>false</inheritedlanguages>
<ishtype>ISHPublication</ishtype>
<logicalid>GUID-789BBB3D-8A09-4916-8857-09A246CB6F59</logicalid>
<version>4</version>
<languages>en, ja</languages>
<resolutions>Low</resolutions>
<ishfields>
<ishfield name="FCOMMENTS" level="lng"></ishfield>
<ishfield name="FTRANSLATOR" level="lng">admin</ishfield>
</ishfields>
</data>
Background task configuration
The list below describes the configurable parameters.- DocumentBaselineCompleteMode
- Auto-complete mode. Not used when the starting object is a publication (ishtype is 'ISHPublication'). Possible values are: 'ISHFirstVersion', 'ISHLatestReleased', 'ISHLatestAvailable'.
Default background task configuration example
The following configuration gets and handles a CREATETRANSLATIONFROMREPORT event from the background task queue:<handler eventType="CREATETRANSLATIONFROMREPORT">
<scheduler executeSynchronously="false" />
<authorization type="authenticationContext" />
<execution timeout="01:00:00" recoveryGracePeriod="00:10:00" isolationLevel="None" useSingleThreadApartment="false" />
<activator>
<net name="CreateTranslationFromReport">
<parameters>
<parameter name="DocumentBaselineCompleteMode">ISHLatestReleased</parameter>
</parameters>
</net>
</activator>
<errorHandler maximumRetries="3">
<actions>
<!-- For a timeout or a lock, wait longer before retrying -->
<add errorNumber="-140" action="Retry" delay="00:10:00"/>
<!-- Just retry -->
<add errorNumber="*" action="Retry" delay="00:01:00"/>
</actions>
</errorHandler>
</handler>
Flow
- Build the report for the starting object to determine the source language objects that has to be translated.
- Determine whether the source language objects from the report all belong to the same logical object. If so, the can all be passed to the "CREATETRANSLATION" background task. If not, they have to be grouped by logical id, to avoid blocking issues and every group should be passed to the "CREATETRANSLATION" background task separately.
- For every group of source language objects that belong to the same logical object:
- Generate a new event data, containing only the source language objects from that group. Assemble the rest of the event data from the incoming event data.
- Using generated event data, create a new background task with event type "CREATETRANSLATION".