BizTalk Scheduled Task Adapter 4.0: Introduction and Installation process

Posted: June 12, 2012 in BizTalk
Tags: , , ,
Introduction

The BizTalk Scheduled Task Adapter is an in-process receive adapter that executes a prescribed task on a daily, weekly or monthly schedule. The adapter is configured entirely within BizTalk, all configurations is stored within the SSODB and can be exported and imported via binding files.

The schedule capabilities are similar to those available with the Windows Scheduled Task Service.

Four simple tasks are included in this version:

  • XmlStringStreamProvider – generates a BizTalk message from a configured Xml string
  • FileStreamProvider – generates a BizTalk message from the contents of a file
  • HttpDownload – generates a BizTalk message from data downloaded from a web site
  • SQLStreamProvider – generates a BizTalk message from the contents of a SQL Query (similar to the old SQL adapter)

Custom tasks can be created. Any .NET class that implements the appropriate interface can be scheduled.

Release History

This adapter is available since BizTalk Server 2004.

  • Release 1.02: last release in Apr 20 2008 by Greg Forsythe, this adapter works with BizTalk Server 2004, BizTalk Server 2006 and BizTalk Server 2006 R2. Compiled in .NET Framework 1.1
  • Release 2.0: last release in Apr 20 2008 by Greg Forsythe, this adapter works with BizTalk Server 2006 and BizTalk Server 2006 R2. Compiled in .NET Framework 2.0
  • Release 3.0: release in Aug 10 2010 by Greg Forsythe, this adapter was tested to work on BizTalk Server 2009. Compiled in .NET Framework 2.0
  • Release 4.0: release in June 12 2012 by Sandro Pereira, this adapter was tested to work on BizTalk Server 2010. Compiled in .NET Framework 4.0
Requirements

The Scheduled Task Adapter v4.0 will work with:

  • BizTalk Server 2010
  • .NET Framework 4.0

 

Installation Process

To install the adapter run "ScheduledTaskAdapter.msi".

  • In the “Welcome” screen press “Next”.

Scheduler-Task-Adapter-welcome-screen

  • In the “Select Installation Folder” screen you must set the installation locations were you what to install the adapter.

Scheduler-Task-Adapter-installation-folder-screen

  • The following screens are very straightforward – In the “Confirm Installation” screen press “Next”, then it will appear the installation progress and assuming all goes well a completion screen.

Scheduler-Task-Adapter-confirmation-screen

Scheduler-Task-Adapter-complete-screen

The setup will install the following assemblies in the selected folder (Default: C:\Program Files (x86)\Biztalk ScheduledTask Adapter):

  • Biztalk.Adapter.ScheduledTaskProperties.dll
  • Calendar.Schedules.dll
  • Microsoft.BizTalk.CommonSettings.dll
  • Microsoft.BizTalk.SqmFramework.dll
  • ScheduledTaskAdapter.Admin.dll
  • ScheduledTaskAdapter.dll
  • ScheduledTaskAdapter.TaskComponents.dll
  • stdole.dll

The setup will add the following assemblies to the Global Assembly Cache (GAC)

  • Biztalk.Adapter.ScheduledTaskProperties.dll
  • Calendar.Schedules.dll
  • ScheduledTaskAdapter.dll
  • ScheduledTaskAdapter.Admin.dll
  • ScheduledTaskAdapter.TaskComponents.dll

 

Post-Installation
Register the Adapter with BizTalk

As it happens with all adapters that we installed on our BizTalk Servers before we can begin to use it we need to register or configure the adapter. To accomplish that we need to:

  • Open BizTalk Administration Console
  • In the console left tree, expand “BizTalk Server Administration –> BizTalk Group –> Platform Settings” and then “Adapters”
  • Right-click on “Adapters” and add a new adapter by selecting the option “New –> Adapter”

register-Scheduler.Task-Adapter-New-Adapter

  • In the “Adapter Properties” window
    • Set the name of the adapter: Name = Schedule
    • In the adapter combo box select the option: Schedule
    • Set the description of the adapter: “BizTalk Scheduled Task Adapter. The schedule capabilities are similar to those available with the Windows Scheduled Task Service.” (this property is optional but I would suggest to always be filled)

register-Scheduler.Task-Adapter-New-Adapter-select-adapter-properties

Note: This configuration requires that you restart the host instance associated with the adapter.

register-Scheduler.Task-Adapter-New-Adapter-restart-host-instances

Using the adapter Context Properties

To utilize the Scheduled Task adapter’s context properties within a filter or orchestration the Biztalk.Adapter.ScheduledTaskProperties.dll must be deployed into the BizTalkMgmtDb.

This can be achieved using the Biztalk Deployment Wizard or equivalent tool.

Note: This step is optional; you only need to do this if you want to use Scheduled Task adapter’s context properties within a filter or orchestration.

As previously mentioned, you can deploy Biztalk.Adapter.ScheduledTaskProperties.dll in various ways; I suggest that you do the following steps:

  • Open BizTalk Administration Console
  • In the console left tree, expand “BizTalk Server Administration –> BizTalk Group” and then “Applications”
  • Right-click on “Applications” and add a new application by selecting the option “New –> Application”

New-application

  • In the “Adapter Properties” window
    • Set the name of the application: BizTalk.Global
    • Set the description of the application: “Application that contain common resources to several applications” (this property is optional but I would suggest to always be filled)

New-application-properties

  • Expand the application created previous and select the option “Resources”
  • Right-click and add a new BizTalk resource by selecting the option “New –> BizTalk Assemblies…”

New-resource

  • In the “Add Resources” window select “Add…” button and from the installation directory select the DLL “Biztalk.Adapter.ScheduledTaskProperties.dll”
    • And select the options: “Overwrite all”, “Add to the global assembly cache on add resource (gacutil)” and “Add to the global assembly cache on MSI file install (gacutil)”

New-resource-dll

  • Select “OK” button

Important note: The BizTalk assembly containing the orchestration code must also add this assembly as a reference

List of improvements in version 4.0

In this new version are available small improvements compared to the current version (3.0). We can highlight the following improvements or changes:

  • 24 hours support in “start time” property. Previous versions had an issue with setting the start time, as it shown 12 hours watch but no AM/PM.
  • Daily scheduler review. Solved a small bug on Daily Properties: unable to switch between “Every day” and “on these days”
  • Installation experience improved. You no longer need to manually add the DLL in GAC.
  • Support for 32 and 64 bit Host Instances.
  • Compiled in Visual Studio 2010 and .NET Framework 4.0.
  • Optimized for BizTalk Server 2010.
  • Documentation improved.
About these ads
Comments
  1. Miguel Carvalho says:

    Olá Sandro!

    Antes te mais muito obrigado pelo desenvolvimento da versão 4.0 que permite agora a utilização com a versão 2010 do Biztalk! Infelizmente estou a ter alguns problemas em usar o componente, mas vou descrever em Inglês pois acho que poderá ser útil para outros utilizadores.

    I’m trying to use the component in Biztalk 2010, but unfortunately it is not work properly. Biztalk claims that the Microsoft.BizTalk.Scheduler.dll, version 3.0.1.0 is not present. This was the case before I found the dll in Biztalk’s install folder. I installed it in GAC, but somehow it ended up in the old GAC, opposite to what I expected (C:\Windows\Microsoft.NET\assembly\GAC_MSIL).

    Moreover, Biztalk throws the following error in Windows Event Log (Event ID 5740): The adapter “ScheduledTask” raised an error message. Details “FileTransfer.TransmitTrigger: has been disabled”. FileTransfer.TransmitTrigger is the name in the General Tab.

    Can it be that I’m using the wrong Microsoft.BizTalk.Scheduler.dll assembly? If so, where to find the correct one?

    Desde já muito obrigado.
    Cumprimentos,
    Miguel

  2. Anonymous says:

    It appears this adapter failed when the time changed to Daylight Savings Time. Has anyone encountered this before? Is it a issue with cache?

  3. Tomi Koivisto says:

    Are you planning to build and test this with VS2012 and Biztalk 2013?

  4. Charles says:

    Hi Sandro,

    What is the predicted behavior of the adapter in a non-clustered Multi-server environment?

    Can I expect multiple activations when hostinstances associated with the adapter run on multiple servers? If so, can/must it be clustered?

    Thanks,

    Charles.

    • Hi Charles,

      Yes you will get multiple activations. The reason is that a receive location is operational on all running host instances, it will be fire once for every running host instance.

      If you have two or more host instances running in the same host, the receive port running the scheduler task adapter that is running in this host you will get two or more messages published at the same time.

      So you can only have a single instance of any Scheduled Task adapter receive location running at any time. Otherwise you will receive duplicate messages.

      You can have two way to provide fail over:
      - Have the host instance service running on one server and stopped on the other server.
      - Or you can use Cluster Services to automate this.

  5. Hi Sandro,

    Any update on release of the new version for BizTalk Server 2013?

    Thanks!

    Gautam

    • Hi Gyanendra,
      I’m doing test with this version and the good news is that for now I didn’t detect any kind of problems in running BizTalk Scheduled Task Adapter 4.0 on BizTalk Server 2013.

      I can say that the bases features tested in this version are fully compatible with BizTalk Server 2013.

  6. Tom says:

    Hi Sandro,

    When configuring a monthly activation interval, on the ‘second Tuesday’, using either one month or multiple months, we receive this error.

    The Messaging Engine failed to add a receive location “Rcv_Assessment_Schedule” with URL “schedule://Monthly/Assessment” to the adapter “Schedule”. Reason: “Time-out interval must be less than 2^32-2.
    Parameter name: dueTime”.

    When reopening the Scheduler configuration window, the ‘second Tuesday’ radio check button is UnSelected.

    Has anyone found this same issue, is there a work around to set a typical quarterly activation schedule?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s