Scheduled Task Adapter
After considering the options for a project where interfacing in a scheduled manner was required i came across the Scheduled task adapter. This thing is so easy to use, I must speak about it!
The following section describes the steps required to implement the scheduled task adapter.
Installation
Register the components
To install the Scheduled task adapter download the adapter from ‘Codeplex’ (http://biztalkscheduledtask.codeplex.com/). Run the setup and follow the steps during the setup.
Note: In the current version the setup does not register the necessary dll’s in the Global Assembly Cache. These steps have to be performed manually.
- Start the Visual Studio command prompt
- Navigate to ‘C:\Program Files\Biztalk ScheduledTask Adapter’
- Run ‘GACUTIL –i Biztalk.Adapter.ScheduledTaskProperties.dll’
- Run ‘GACUTIL –i Calendar.Schedules.dll’
- Run ‘GACUTIL –i ScheduledTaskAdapter.Admin.dll’
- Run ‘GACUTIL –i ScheduledTaskAdapter.dll’
- Run ‘GACUTIL –i ScheduledTaskAdapter.TaskComponents.dll’
Add the adapter
Start the administration console and create a new adapter under ‘Platform settings’.
Select the Schedule adapter and name it as desired, for example ScheduledTaskAdapter
Restart the host instance
Configuration
The Scheduled task adapter has the ability to fire a trigger based on a regular interval. This trigger can be defined as desired, the most common usage is to use a String trigger which will submit a predefined String (e.g. an Xml message) to the messagebox so that it can be picked up by an Orchestration.
The first step is to create a new Receive port that will contain a receive location using the ScheduledTaskAdapter.
Create a new One-Way receive port
Create a new Receive location and select the ScheduledTaskAdapter, ensure that you choose XMLReceive as the receive pipeline.
Click on Configure and define a name for the schedule
Define a schedule which executes the tasks periodically
Select a task component
This tab allows the usage of implemented Task items. These are the actions performed, you can implement any task as long as it conforms to the API of the ScheduledTaskAdapter. In this case we will use a task type that is included with the Adapter.
Click on ‘FindTask’, this will show the assembly browser
Click on ‘Browse’ and select the assembly ‘ScheduledTaskAdapter.TaskComponents.dll’ (located in the Program Files\Biztalk ScheduledTask Adapter directory).
Double click the XMLStringStreamProvider and click ok
Under taskproperties, configure the XmlString that will be published on the messagebox at the moment the task is executed
Note: this is a xml instance that you can used as the first receive shape in the orchestration that should be started.
Have fun with it!
Comments