BackgroundTask 2.5 Find
Used to identify all background tasks that match the criteria given in the metadata filter.
Parameters
| Name | Type | Direction | Description |
|---|---|---|---|
| psAuthContext | String | InOut | Deprecated proprietary authentication context only used by .ASMX web services based on internal username/password authentication. Claims based security standards drive all the WCF .SVC web services, making this parameter redundant. |
| pdModifiedSince | Date | In | A date limiting the background tasks that will be retrieved based on the last modification date of the background tasks |
| peUserFilter | eUserFilter | In | Enumeration indicating if only background tasks of the current user or all background tasks must be retrieved |
| psXMLMetadataFilter | String | In | Background Task Metadata Filter XML structure with additional filter on metadata to limit the background tasks on which metadata has to be returned. |
| psXMLRequestedMetadata | String | In | Requested Background Task Metadata XML structure indicating which metadata has to be retrieved for the given background tasks |
| psOutXMLTaskList | String | Out | Background Tasks XML structure containing the metadata of the background tasks. |
Note that:
- Although all dates (
CREATIONDATE,EXECUTEAFTERDATE,LEASEDON,...) are stored as UTC date time in the database,- the filter values in
psXMLMetaDataFilterare assumed to be in the local date time of the application server - the requested dates are returned in the local date time of the application server
- the filter values in
- If the parameter peUserFilter is set to
Current, only background tasks that are associated with the current user will be retrieved. Otherwise the background tasks associated to all users are retrieved. - You can retrieve the data reference of the inputdata (= INPUTDATAID) and outputdata (=OUTPUTDATAID), but this method will not return the content itself.
- The
historylevel contains information about one single execution of the background task.- As long as the background task did not start to execute the background task yet, there is not
historyinformation. - If you don"t filter on
historyinformation, the information of the background task is returned even if the requested metadata contains fields of thehistorylevel and there is nohistoryinformation yet.
- As long as the background task did not start to execute the background task yet, there is not
Which fields can be used to filter or retrieve information?
| Field | Level | Description |
|---|---|---|
| TASKID | task | The column "TASKID" contains the unique identifier of the background task. This value can only be used for filtering! |
| HISTORYID | history | The column "HISTORYID" contains the unique identifier of one of the history record of the background task. This value can only be used for filtering! |
| USERID | task | The user that started the background task
|
| STATUS | task | The status of the background task
|
| HASHID | task | String containing the "hash" representation for this background task. This will be used to skip older background task for the same action. For instance, synchronizing the same language object only once to SDL LiveContent. |
| EVENTTYPE | task | The type of the event (e.g PUBLISH) |
| PROGRESSID | task | The unique identifier of the event log linked with this background task |
| TRACKINGID | task | Currently the trackingId is the same as the progressId |
| CREATIONDATE | task | The date time that the background task was created |
| MODIFICATIONDATE | task | The date time that the background task was last modified |
| EXECUTEAFTERDATE | task | The background task should not be executed before this date time. |
| LEASEDON | task | The date and time when background task was leased |
| LEASEDBY | task | The id of the process/thread that leased the background task |
| CURRENTATTEMPT | task | Number containing the current attempt |
| INPUTDATAID | task | Data reference linking to the inputdata of the background task |
| OUTPUTDATAID | task | Data reference linking to the outputdata of the last execution of the background task |
| EXITCODE | history | The exit code for this background task execution |
| ERRORNUMBER | history | The error number thrown by this background task execution |
| OUTPUT | history | Data reference linking to the outputdata of this background task execution |
| ERROR | history | Data reference linking to the detailed error of this background task execution |
| STARTDATE | history | The date time that this execution of the background task was started |
| ENDDATE | history | The date time that this execution of the background task was finished |
| HOSTNAME | history | The host name from which the background task was created |
What are the possible statuses?
| Label | Element | Description |
|---|---|---|
| Pending | VBACKGROUNDTASKSTATUSPENDING | The background task waiting to be executed by the service. This status can occur when:
|
| Executing | VBACKGROUNDTASKSTATUSEXECUTING | The background task service is running the background task |
| Skipped | VBACKGROUNDTASKSTATUSSKIPPED | The background task service found a more recent background task with the same hashId. The current background task is skipped and the more recent one will be executed. |
| Failed | VBACKGROUNDTASKSTATUSFAILED | If there was no successful execution after the configured number of attempts, the background task is marked as failed. |
| Success | VBACKGROUNDTASKSTATUSSUCCESS | The background task finished "successfully".
|
Example
When you do the BackgroundTask25.Find for the
Current user with following metadata filter:
<ishfields>
<ishfield name="EVENTTYPE" level="task" ishvaluetype="element">VEVENTTYPEPUBLISH</ishfield>
</ishfields>
and following requested metadata:
<ishfields>
<ishfield name="USERID" level="task"/>
<ishfield name="USERID" level="task" ishvaluetype="element"/>
<ishfield name="HASHID" level="task"/>
<ishfield name="STATUS" level="task"/>
<ishfield name="STATUS" level="task" ishvaluetype="element"/>
<ishfield name="EVENTTYPE" level="task"/>
<ishfield name="EVENTTYPE" level="task" ishvaluetype="element"/>
<ishfield name="PROGRESSID" level="task"/>
<ishfield name="TRACKINGID" level="task"/>
<ishfield name="CREATIONDATE" level="task"/>
<ishfield name="MODIFICATIONDATE" level="task"/>
<ishfield name="EXECUTEAFTERDATE" level="task"/>
<ishfield name="LEASEDON" level="task"/>
<ishfield name="LEASEDBY" level="task"/>
<ishfield name="CURRENTATTEMPT" level="task"/>
<ishfield name="INPUTDATAID" level="task"/>
<ishfield name="OUTPUTDATAID" level="task"/>
<ishfield name="EXITCODE" level="history"/>
<ishfield name="ERRORNUMBER" level="history"/>
<ishfield name="OUTPUT" level="history"/>
<ishfield name="ERROR" level="history"/>
<ishfield name="STARTDATE" level="history"/>
<ishfield name="ENDDATE" level="history"/>
<ishfield name="HOSTNAME" level="history"/>
</ishfields>
this can result in something like:
<?xml version="1.0" encoding="utf-16"?>
<ishbackgroundtasks>
<ishbackgroundtask ishtaskref="169075" ishhistoryref="122259">
<ishfields>
<ishfield name="USERID" level="task">admin</ishfield>
<ishfield name="USERID" level="task" ishvaluetype="element">VUSERADMIN</ishfield>
<ishfield name="HASHID" level="task">464975</ishfield>
<ishfield name="STATUS" level="task">Failed</ishfield>
<ishfield name="STATUS" level="task" ishvaluetype="element">VBACKGROUNDTASKSTATUSFAILED</ishfield>
<ishfield name="EVENTTYPE" level="task">PUBLISH</ishfield>
<ishfield name="EVENTTYPE" level="task" ishvaluetype="element">VEVENTTYPEPUBLISH</ishfield>
<ishfield name="PROGRESSID" level="task">477496</ishfield>
<ishfield name="TRACKINGID" level="task">477496</ishfield>
<ishfield name="CREATIONDATE" level="task">21/09/2018 16:18:43</ishfield>
<ishfield name="MODIFICATIONDATE" level="task">21/09/2018 16:18:58</ishfield>
<ishfield name="EXECUTEAFTERDATE" level="task">21/09/2018 16:18:43</ishfield>
<ishfield name="LEASEDON" level="task">21/09/2018 16:18:58</ishfield>
<ishfield name="LEASEDBY" level="task"/>
<ishfield name="CURRENTATTEMPT" level="task">1</ishfield>
<ishfield name="INPUTDATAID" level="task">177428</ishfield>
<ishfield name="OUTPUTDATAID" level="task"/>
<ishfield name="EXITCODE" level="history"/>
<ishfield name="ERRORNUMBER" level="history">-142</ishfield>
<ishfield name="OUTPUT" level="history"/>
<ishfield name="ERROR" level="history">177431</ishfield>
<ishfield name="STARTDATE" level="history">21/09/2018 16:18:52</ishfield>
<ishfield name="ENDDATE" level="history">21/09/2018 16:18:58</ishfield>
<ishfield name="HOSTNAME" level="history">devserver01</ishfield>
</ishfields>
</ishbackgroundtask>
<ishbackgroundtask ishtaskref="169080" ishhistoryref="122264">
<ishfields>
<ishfield name="USERID" level="task">admin</ishfield>
<ishfield name="USERID" level="task" ishvaluetype="element">VUSERADMIN</ishfield>
<ishfield name="HASHID" level="task">1041540</ishfield>
<ishfield name="STATUS" level="task">Success</ishfield>
<ishfield name="STATUS" level="task" ishvaluetype="element">VBACKGROUNDTASKSTATUSSUCCESS</ishfield>
<ishfield name="EVENTTYPE" level="task">PUBLISH</ishfield>
<ishfield name="EVENTTYPE" level="task" ishvaluetype="element">VEVENTTYPEPUBLISH</ishfield>
<ishfield name="PROGRESSID" level="task">477501</ishfield>
<ishfield name="TRACKINGID" level="task">477501</ishfield>
<ishfield name="CREATIONDATE" level="task">21/09/2018 16:20:45</ishfield>
<ishfield name="MODIFICATIONDATE" level="task">21/09/2018 16:21:29</ishfield>
<ishfield name="EXECUTEAFTERDATE" level="task">21/09/2018 16:20:45</ishfield>
<ishfield name="LEASEDON" level="task">21/09/2018 16:21:29</ishfield>
<ishfield name="LEASEDBY" level="task"/>
<ishfield name="CURRENTATTEMPT" level="task">1</ishfield>
<ishfield name="INPUTDATAID" level="task">177434</ishfield>
<ishfield name="OUTPUTDATAID" level="task"/>
<ishfield name="EXITCODE" level="history"/>
<ishfield name="ERRORNUMBER" level="history">0</ishfield>
<ishfield name="OUTPUT" level="history"/>
<ishfield name="ERROR" level="history"/>
<ishfield name="STARTDATE" level="history">21/09/2018 16:21:00</ishfield>
<ishfield name="ENDDATE" level="history">21/09/2018 16:21:29</ishfield>
<ishfield name="HOSTNAME" level="history">devserver01</ishfield>
</ishfields>
</ishbackgroundtask>
<ishbackgroundtask ishtaskref="169082" ishhistoryref="122266">
<ishfields>
<ishfield name="USERID" level="task">admin</ishfield>
<ishfield name="USERID" level="task" ishvaluetype="element">VUSERADMIN</ishfield>
<ishfield name="HASHID" level="task">464975</ishfield>
<ishfield name="STATUS" level="task">Executing</ishfield>
<ishfield name="STATUS" level="task" ishvaluetype="element">VBACKGROUNDTASKSTATUSEXECUTING</ishfield>
<ishfield name="EVENTTYPE" level="task">PUBLISH</ishfield>
<ishfield name="EVENTTYPE" level="task" ishvaluetype="element">VEVENTTYPEPUBLISH</ishfield>
<ishfield name="PROGRESSID" level="task">477503</ishfield>
<ishfield name="TRACKINGID" level="task">477503</ishfield>
<ishfield name="CREATIONDATE" level="task">21/09/2018 16:23:55</ishfield>
<ishfield name="MODIFICATIONDATE" level="task">21/09/2018 16:24:02</ishfield>
<ishfield name="EXECUTEAFTERDATE" level="task">21/09/2018 16:23:55</ishfield>
<ishfield name="LEASEDON" level="task">21/09/2018 16:24:02</ishfield>
<ishfield name="LEASEDBY" level="task">devserver01#6032#414b55d6e0c34c40a8da89d3864e5624</ishfield>
<ishfield name="CURRENTATTEMPT" level="task">1</ishfield>
<ishfield name="INPUTDATAID" level="task">177436</ishfield>
<ishfield name="OUTPUTDATAID" level="task"/>
<ishfield name="EXITCODE" level="history"/>
<ishfield name="ERRORNUMBER" level="history"/>
<ishfield name="OUTPUT" level="history"/>
<ishfield name="ERROR" level="history"/>
<ishfield name="STARTDATE" level="history">21/09/2018 16:24:04</ishfield>
<ishfield name="ENDDATE" level="history"/>
<ishfield name="HOSTNAME" level="history">devserver01</ishfield>
</ishfields>
</ishbackgroundtask>
<ishbackgroundtask ishtaskref="169084">
<ishfields>
<ishfield name="USERID" level="task">admin</ishfield>
<ishfield name="USERID" level="task" ishvaluetype="element">VUSERADMIN</ishfield>
<ishfield name="HASHID" level="task">464977</ishfield>
<ishfield name="STATUS" level="task">Pending</ishfield>
<ishfield name="STATUS" level="task" ishvaluetype="element">VBACKGROUNDTASKSTATUSPENDING</ishfield>
<ishfield name="EVENTTYPE" level="task">PUBLISH</ishfield>
<ishfield name="EVENTTYPE" level="task" ishvaluetype="element">VEVENTTYPEPUBLISH</ishfield>
<ishfield name="PROGRESSID" level="task">477505</ishfield>
<ishfield name="TRACKINGID" level="task">477505</ishfield>
<ishfield name="CREATIONDATE" level="task">21/09/2018 16:24:06</ishfield>
<ishfield name="MODIFICATIONDATE" level="task">21/09/2018 16:24:06</ishfield>
<ishfield name="EXECUTEAFTERDATE" level="task">21/09/2018 16:24:06</ishfield>
<ishfield name="LEASEDON" level="task"/>
<ishfield name="LEASEDBY" level="task"/>
<ishfield name="CURRENTATTEMPT" level="task">1</ishfield>
<ishfield name="INPUTDATAID" level="task">177438</ishfield>
<ishfield name="OUTPUTDATAID" level="task"/>
</ishfields>
</ishbackgroundtask>
</ishbackgroundtasks>