The BizTalk Scheduled Task Adapter is an in process receive adapter that can be implemented on a receive location to execute a prescribed task on a daily, weekly or monthly schedule.
I have previously talked about the installation of the Scheduled Task Adapter with BizTalk Server 2009, detailed below are details of how this adapter can be configured on a receive port.
Within the BizTalk Administration console, right click and add a new one way receive location.
Select the receive port that your receive location will run under - if you haven't got a port you will need to create one.
Name the receive location and select the previously installed adapter from the Transport type drop down. You can also set the receive pipeline at this stage.
Select configure and you will then be able to set the Scheduled Task Adapter transport properties; Name, Schedule and Task Properties.
After typing in a suitable name, select the Schedule properties and you will then be able to configure the schedule that your receive location will follow.
First up is the start date and time, which will control when the scheduled adapter will start working. This will also affect when any subsequent attempts will be made. For instance setting the time to 4pm and the frequency to Daily with a time span of 24 hours will cause a scheduled event at 4pm each day.
Beneath the start date and time are four tabs that allow you to configure the details of the schedule; Daily, Weekly, Monthly and Time Span.
The Daily Tab allows you to set either how many days there should be between events or which days the event should fire on.
The Weekly Tab allows you to define how many weeks there should be between events and which days of the week events should occur on.
The Monthly Tab allows you to set a number of parameters that affect the monthly schedule of events; either the date in the month or an occurance based day (e.g. first saturday). In both cases you can also set the months that the event will fire in.
The Time Span tab allows you to specify the interval between events in either Hours, Minutes or Seconds.
My current assumptions are that the order of precedence is most frequent to less frequent, but I have yet to test this extensively. For example setting Daily to "every 1 days" should override setting weekly to every 1 week. If I find any interesting combinations when using this adapter I will aim to log these at a later date.
Following the configuration of the schedule properties, the final thing to configure is the Task properties. These define what the event that occurs with your schedule will actually be.
The Scheduled Task Adapter is capable of working with any code that implements the correct interface, with the following event types provided by default: FileStream, HttpDownload and XMLStrings.
On the Task Properties windows press Find Task.
You should then see the Assembly Qualified Type Name window. Select browse to search for a suitable dll.
To make use of the default event types navigate to C:\Program Files\Biztalk ScheduledTask Adapter and select the ScheduledTask.TaskComponents.dll file. You should now see the updated Assembly Qualified Type Name window which now shows the events available in the dll selected.
In this case we will be trying the XMLStringStreamProvider, select this in the Assembly window and press the select button - this will then populate the Type Name text box.
Pressing okay will return you to the Task Properties windows which will have been updated with the parameters for your chosen task. In this case we need to set the xml string to be used with the event. This is done in the xml text editor window.
You have now configured a Scheduled Task Event Adapter receive location to submit your configured xml to the BizTalk message box - with the potential to start any send port or orchestration to your required schedule.