Documentation Center

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
objectid
Logical ID of the object.
  • Required: yes
version
Version number of the object.
  • Required: yes
sourcelanguages
Source languages that are used.
  • Required: yes
masterref
Comma-separated logical IDs representing the master reference.
  • Required: yes
resources
Comma-separated logical IDs of the resources to be used.
  • Required: no
resolutions
Resolutions that are used.
  • Required: yes
baselinename
Name of the baseline.
  • Required: yes
lnglist
Comma-separated list of languages.
  • Required: yes
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
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
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).

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

  1. Initialize
    1. Read configuration.
    2. Set initial batch progress status.
    3. Read input data.
  2. For each language in input data
    1. Write a record with language name to the Event Monitor.
    2. Get all items for this language.
    3. Group items per type.
    4. 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.
    5. 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).
    6. Write a record in Event Monitor indicating that processing of a language is completed.
    7. Update batch progress status.