Documentation Center

IBackgroundTaskHandler - DitaDeliveryCheckRemoteStatus

Checks the execution statuses of the packages by polling the Deployer. If some packages are not finished processing at the moment this background task polls, the background task will reschedule itself to check again later.

Input data

The input data XML identifies a publication output.

ishobject @ishLngRef
Defines the identifier of the language level.
  • Required: yes
ishfields
A Metadata XML structure that holds some extra fields information. For this plugin the FISHEVENTID field is required.
  • Required: yes
ishobject @numberOfChecksPerformed
Defines the number of checks that have been performed already. If the input data is received the first time, the numberOfChecksPerformed attribute is not present, and the default value is used.
  • Required: no
  • Default value: 0
ishobject @publishMaximumProgress

Indicates the maximum progress after the publish is finish. So, without the progress of the DitaDeliveryCheckRemoteStatus.

If the input data is received the first time, the publishMaximumProgress attribute is not present, and the maximum progress is retrieved from the database.

  • Required: no
  • Default value: 0

Input data example

This XML example shows typical event input data for this background task:
<ishobject ishref="GUID-789BBB3D-8A09-4916-8857-09A246CB6F59" ishtype="ISHPublication" ishlngref="1420746" numberOfChecksPerformed="1" publishMaximumProgress="2200">
  <ishfields>
    <ishfield name="VERSION" level="version">3</ishfield>
    <ishfield name="DOC-LANGUAGE" level="lng">en</ishfield>
    <ishfield name="FISHEVENTID" level="lng">PUBLISHDITADELIVERY MECDEVAPP01 20170918084342768 1827364603</ishfield>
  </ishfields>
</ishobject>

Background task configuration

The list below describes the configurable parameters.
WaitTimeBetweenChecksPerZip
Time between execution statuses checks per ZIP package. The actual waiting time between checks is calculated as (waitTimeBetweenChecksPerZip multiplied by the number of packages). If the calculated waiting time between checks is less than 60 seconds, the system will use 60 seconds to avoid checking too often.
  • Required: yes
  • Default value: 00:00:10
  • Allowed values: valid HH:mm:ss timespan value
MaximumNumberOfChecks
The maximum number of checks after which the background task stops and changes publication output status to Failed.
  • Required: yes
  • Default value: 100
  • Allowed values: valid number
RemoteTimeout
The timeout of the http request.
  • Required: no
  • Default value: 00:05:00
  • Allowed values: valid HH:mm:ss timespan value
RemoteNumberOfRetries
The number of times an HTTP request is retried.
  • Required: no
  • Default value: 2
  • Allowed values: valid number
RemoteWaitTimeBetweenRetries
Time to wait between retries of the HTTP request.
  • Required: no
  • Default value: 00:01:00
  • Allowed values: valid HH:mm:ss timespan value

Default background task configuration example

The following configuration gets and handles a DITADELIVERYCHECKREMOTESTATUS event from the background task queue:
<handler eventType="DITADELIVERYCHECKREMOTESTATUS">
  <scheduler executeSynchronously="false"/>
  <authorization type="authenticationContext"/>
  <execution timeout="01:00:00" recoveryGracePeriod="00:10:00" isolationLevel="None" useSingleThreadApartment="false"/>
  <activator>
    <net name="DitaDeliveryCheckRemoteStatus">
      <parameters>
        <!-- Note that the actual waiting time between checks is calculated as (waitTimeBetweenChecksPerZip multiplied by the number of packages). -->
        <!-- If the calculated waiting time between checks is less than 60 seconds, the system will use 60 seconds to avoid checking too often. -->
        <parameter name="WaitTimeBetweenChecksPerZip">00:00:10</parameter>
        <parameter name="MaximumNumberOfChecks">100</parameter>            
      </parameters>
    </net>
  </activator>
  <errorHandler maximumRetries="10">
    <actions>
      <!-- Retry on connection failures to the external system -->
      <add errorNumber="-111001" action="Retry" delay="00:10:00"/>
      <!-- Retry on integration failures to the external system -->
      <add errorNumber="-111002" action="Retry" delay="00:10:00"/>
    </actions>
  </errorHandler>
</handler>

Flow

  1. Checks the execution statuses of the deploying packages.
    1. If all packages are processed and
      1. all processed successfully, the publication output status is changed from Deploying Draft to Draft or from Deploying Release Candidate to Release Candidate.
      2. one of the packages failed, the publication output status is changed to Failed.
    2. If not all packages are processed
      1. If the value of the numberOfChecksPerformed parameter is less than the value of the MaximumNumberOfChecks parameter, a new DitaDeliveryCheckRemoteStatus event is raised that will start after a certain time. This new event has the same event data, but its numberOfChecksPerformed attribute is increased by 1. The delay before start is calculated using the value of the WaitTimeBetweenChecksPerZip parameter multiplied by the number of non-successful packages.
      2. If the value of the numberOfChecksPerformed parameter is more than the value of the MaximumNumberOfChecks parameter, the publication output status is changed to Failed.
    3. At the end of every check the progress in event log is updated:
      • current progress = @publishMaximumProgress + successful deployed packages
      • maximum progress = @publishMaximumProgress + total packages to deploy