IBackgroundTaskHandler - BatchWorkflow
Update statuses for the items in a specified languages inside a publication.
Input data
The input data XML:
- ishtype
-
Type of the object workflow runs for. Only publication is supported.
- Required:
yes
- Required:
- objectid
-
Logical ID of the object.
- Required:
yes
- Required:
- version
-
Version number of the object.
- Required:
yes
- Required:
- sourcelanguages
-
Source languages that are used.
- Required:
yes
- Required:
- masterref
-
Comma-separated logical IDs representing the master reference.
- Required:
yes
- Required:
- resources
-
Comma-separated logical IDs of the resources to be used.
- Required:
no
- Required:
- resolutions
-
Resolutions that are used.
- Required:
yes
- Required:
- baselinename
-
Name of the baseline.
- Required:
yes
- Required:
- lnglist
-
Comma-separated list of languages.
- Required:
yes
- Required:
This XML examples shows the typical input data:
<eventdata>
<ishtype>ISHPublication</ishtype>
<objectid>GUID-789BBB3D-8A09-4916-8857-09A246CB6F59</objectid>
<version>8</version>
<sourcelanguages>en</sourcelanguages>
<masterref>GUID-C9CA7357-CBA3-43B3-A4B2-B977AD1B7D1E</masterref>
<resources>GUID-8C023953-0F7C-4986-9DE2-568FF183FC25, GUID-9E48AEC2-2AF4-444A-85C2-A96EE537A340, ...</resources>
<resolutions>Low</resolutions>
<baselinename>Publication MP330-v8-GUID-789BBB3D-8A09-4916-8857-09A246CB6F59-2019/08/08 16:29:06</baselinename>
<lnglist>fr</lnglist>
</eventdata
Background task configuration
The list below describes the configurable parameters:- tostatus
-
Status to assign for the objects.
- Required:
yes - Default value: n/a
- Allowed values: Any available status.
- Example: VSTATUSRELEASED
- Required:
- batchsize
-
Maximum number of items allowed to process by one batch. If there are more items to process they are split between different batches.
- Required:
yes - Default value: n/a
- Allowed values: Any integer number greater than 0 and less or equal than 2 147 483 647.
- Example: 500
- Required:
- retrywaittime
-
Objects might be locked when the batch is executed so it is useful to wait and perform a second attempt to update them. This parameter defines how much time a job should wait before it tries again.
- Required:
no - Default value: 00:01:00 (1 minute)
- Allowed values: Any time span in format HH:MM:SS
- Example: 01:00:00 (1 hour), 00:00:30 (30 seconds).
- Required:
Default background task configuration example
The following configuration handles the BatchWorkflow background task:
<handler eventType="RELEASETRANSLATIONS">
<scheduler executeSynchronously="false" />
<authorization type="authenticationContext" />
<execution timeout="01:00:00" recoveryGracePeriod="00:10:00" isolationLevel="None" useSingleThreadApartment="false" />
<activator>
<net name="BatchWorkflow">
<parameters>
<parameter name="tostatus">VSTATUSRELEASED</parameter>
<parameter name="batchsize">500</parameter>
<parameter name="retrywaittime">00:01:00</parameter>
</parameters>
</net>
</activator>
<errorHandler maximumRetries="0" />
</handler>
Flow
- Initialize
- Read configuration.
- Set initial batch progress status.
- Read input data.
- For each language in input data
- Write a record with language name to the Event Monitor.
- Get all items for this language.
- Group items per type.
- For each item type
- Write a record to the Event Monitor indicating how many objects are processed and a list with the object names.
- Set the configured status to the language objects of a type.
- Write a record to the Event Monitor with the details about how many objects were processed, how many of those failed and how many objects were processed in total.
- If there are unprocessed items (for example, they were blocked at the time of execution)
- Wait a timeout specified in the configuration.
- Retry status update for all unprocessed items in the same way they are processed normally (see above).
- Write a record in Event Monitor indicating that processing of a language is completed.
- Update batch progress status.