Documentation Center

IBackgroundTaskHandler - DitaDeliveryCheckRemoteUnpublishStatus

Checks the execution statuses of the packages send for the unpublish 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.

The input data XML identifies a publication output:

export-document-type
The ishtype of the starting object. The value is always ISHPublication.
  • Required: yes
export-document-level
The level of the starting object. The value is always lng.
  • Required: yes
export-ishlngref
The numerical identifier of the publication output.
  • Required: yes
creationdate
Date time indicating when the unpublish was triggered.
  • Required: no
deployerids
String with the deployerId which is normally the file name of the package
  • Required: yes
data @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
data @unpublishMaximumProgress

Indicates the maximum progress after the unpublish is finished. So, without the progress of the DitaDeliveryCheckRemoteUnpublishStatus.

If the input data is received the first time, the unpublishMaximumProgress 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:
<data numberOfChecksPerformed="0" unpublishMaximumProgress="1">
  <export-document-type>ISHPublication</export-document-type>
  <export-document-level>lng</export-document-level>
  <export-ishlngref>3762134</export-ishlngref>
  <creationdate>20170424081850692</creationdate>
  <deployerids>ish3762134-1-66560-20180803101340734.zip</deployerids>
</data>

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:01:00
  • 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 Unpublish 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 DITADELIVERYCHECKREMOTEUNPUBLISHSTATUS event from the background task queue:
<handler eventType="DITADELIVERYCHECKREMOTEUNPUBLISHSTATUS">
  <scheduler executeSynchronously="false"/>
  <authorization type="authenticationContext"/>
  <execution timeout="01:00:00" recoveryGracePeriod="00:10:00" isolationLevel="None" useSingleThreadApartment="false"/>
  <activator>
    <net name="DitaDeliveryCheckRemoteUnpublishStatus">
      <parameters>
        <parameter name="WaitTimeBetweenChecksPerZip">00:01:00</parameter>
        <parameter name="MaximumNumberOfChecks">100</parameter>
      </parameters>
    </net>
  </activator>
  <errorHandler maximumRetries="3">
    <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"/>
      <!-- Retry on ObjectInUse internal failures  -->
      <add errorNumber="-140" 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 Unpublishing to To Be Published
      2. one of the packages failed, the publication output status is changed to Unpublish 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 DITADELIVERYCHECKREMOTEUNPUBLISHSTATUS 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 Unpublish Failed.
    3. At the end of every check the progress in event log is updated:
      • current progress = @unpublishMaximumProgress + successful deployed packages
      • maximum progress = @unpublishMaximumProgress + total packages to deploy