IBackgroundTaskHandler - IshShell
Starts an external background process with the specified arguments.
Input data
The input data XML file contains the required data for the handler to work. It is stored in a temporary folder on the file system, and the corresponding file path is passed to the external process as an argument. The input data XML can contain a setendevent element to specify whether or not the handler should end the event.
Background task configuration
The background process to trigger the cIshShell is configured in the background task configuration, which is accessible from the Content Manager web client by selecting .
- location
-
Path to the file system folder where the input data XML is temporarily stored.
- Required: yes
- command
-
The command to be started as external process.
- Required: yes
- passauthenticationcontext
- Boolean value to pass the Authentication Context of the logged in user to the external process. This parameter is optional, if not passed the Authentication Context is not passed on to the external process.
- passeventprogressid
- Boolean value to pass the unique Event Progress Id for the running process. This parameter is optional, if not passed the Event Progress Id is not passed on to the external process.
- cleanup
- Boolean value that indicates whether to remove the temporary eventdata file from the filesystem. This parameter is optional, if not passed the temporary eventdata file will be removed from the filesystem.
- eventmonitorprogressstatus
- Either "calculate" or "lastresult" can be used. When "calculate" is used, the event overview will take into account all event details (when one is "Failed", the event overview will report "Failed"). When "lastresult" is used the event overview will directly be set to last result, so either "Success" or "Failed". This parameter is optional, if not passed the event overview will use "calculate".
- raiseevent
- The event type of the next event in the chain.
Typical usage of this functionality includes:
PUBLISHINGPOSTPROCESSING
ZIPFILES
SYNCHRONIZETOLIVECONTENT
Default background task configuration example
The following configuration gets and handles a SYNCHRONIZETOLIVECONTENT event from the background task queue:
<handler eventType="SYNCHRONIZETOLIVECONTENT">
<scheduler executeSynchronously="false"/>
<authorization type="authenticationContext"/>
<execution timeout="01:00:00" recoveryGracePeriod="00:10:00" isolationLevel="None" useSingleThreadApartment="true"/>
<activator>
<net name="IshShell">
<parameters>
<parameter name="location">%ISHPROJECTDATAPATH%\SynchronizeToLiveContent</parameter>
<!-- This allows powershell to run in 64-bit mode, which is required for Windows Server 2012. -->
<parameter name="command">%windir%\sysnative\WindowsPowershell\v1.0\powershell.exe -executionpolicy unrestricted -noninteractive -noprofile -sta -inputformat none -outputformat none -file "%ISHPROJECTAPPPATH%\Utilities\SynchronizeToLiveContent\SynchronizeToLiveContent.ps1"</parameter>
<parameter name="passauthenticationcontext">yes</parameter>
<parameter name="passeventprogressid">yes</parameter>
<parameter name="cleanup">yes</parameter>
<parameter name="eventmonitorprogressstatus">lastresult</parameter>
</parameters>
</net>
</activator>
<errorHandler maximumRetries="10">
<actions>
<add errorNumber="-131052" action="Retry" delay="01:00:00"/>
<add errorNumber="-125001" action="Retry" delay="01:00:00"/>
<add errorNumber="*" action="Retry" delay="00:10:00"/>
</actions>
</errorHandler>
</handler>