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
- Required:
- ishfields
-
A Metadata XML structure that holds some extra fields information. For this plugin the
FISHEVENTIDfield is required.- Required:
yes
- Required:
- 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
- Required:
- 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
- Required:
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 (
waitTimeBetweenChecksPerZipmultiplied 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
- Required:
- 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
- Required:
- RemoteTimeout
-
The timeout of the http request.
- Required:
no - Default value:
00:05:00 - Allowed values:
valid HH:mm:ss timespan value
- Required:
- RemoteNumberOfRetries
-
The number of times an HTTP request is retried.
- Required:
no - Default value:
2 - Allowed values:
valid number
- Required:
- 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
- Required:
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
- Checks the execution statuses of the deploying packages.
- If all packages are processed and
- all processed successfully, the publication output status is changed from
Deploying DrafttoDraftor fromDeploying Release CandidatetoRelease Candidate. - one of the packages failed, the publication output status is changed to
Failed.
- all processed successfully, the publication output status is changed from
- If not all packages are processed
- If the value of the
numberOfChecksPerformedparameter is less than the value of theMaximumNumberOfChecksparameter, a new DitaDeliveryCheckRemoteStatus event is raised that will start after a certain time. This new event has the same event data, but itsnumberOfChecksPerformedattribute is increased by 1. The delay before start is calculated using the value of theWaitTimeBetweenChecksPerZipparameter multiplied by the number of non-successful packages. - If the value of the
numberOfChecksPerformedparameter is more than the value of theMaximumNumberOfChecksparameter, the publication output status is changed toFailed.
- If the value of the
- 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
- If all packages are processed and