BizTalk Scheduled Task Adapter 4.0: Introduction and Installation process

Posted: June 12, 2012  |  Categories: Adapters BizTalk

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 website
  • 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 on 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 on 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 on 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 on 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 contains common resources to several applications” (this property is optional but I would suggest to always be filled)
New application properties
  • Expand the application created previously 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 the “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 showed 12 hours watch but no AM/PM.
  • Daily schedule 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.
Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc. He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.

22 thoughts on “BizTalk Scheduled Task Adapter 4.0: Introduction and Installation process”

  1. 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:WindowsMicrosoft.NETassemblyGAC_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

      1. Hi Akshay,

        although I never used the adapter in BizTalk 2013, what I observed in BizTalk 2010 is that the adapter writes these messages in the event log as standard when you restart the receive location, so in these situations you should see this as an information rather than an error/warning.
        I found out later that my process wasn’t running due to a change in the way the XML is generated in this version of the adapter, since we migrated from BizTalk 2006 and used therefore the old adapter before.

        Hope it helps

  2. 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. 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.

    1. 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.

    1. 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.

  4. 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?

  5. Hi Sandro,
    I am using the scheduledtaskadapter in BizTalk Servewr 2013R2 to trigger hourly incementatl data migration process. I have found one issue that when I stop the application it creates below error in the event log.
    I have another strange issue found in production. Due to load issue sometimes I restart the host instances, during this time I found that two instances of orchestration are fired. I am still analysing the issue but from log/investigation I could see multiple instances of orchestrations are fired.

    Error:
    The adapter “ScheduledTaskAdapter” raised an error message. Details ”
    test: has been disabled”.

    Thanks in advance.

    Regards
    Nilesh Sawant

  6. Hi Sandro,

    I have an requirement where I want to read multiple files from location and perform this schedule task activity based on input of files,…

    I am trying to change the GetStream Method so that it can return stream array to adapter .. but it is getting failed with below error.. at receive port

    task is shutting down. Details:”Unable to cast object of type ‘ScheduledTaskAdapter.TaskComponents.FileStreamProvider’ to type ‘ScheduledTaskAdapter.TaskComponents.IScheduledTaskStreamProvider’.”.

    I have changed method as below

    public Stream[] GetStream(object parameter)
    {
    string inputPath = Convert.ToString(parameter);
    string[] totalFiles = Directory.GetFiles(inputPath);
    Stream[] myStream = new Stream[totalFiles.Length];
    for (int i = 0; i < totalFiles.Length; i++)
    {
    myStream[i]= new FileStream(totalFiles[i], FileMode.Open, FileAccess.Read);
    }

    return myStream;

    }

    Thanks,
    Amit Patel

  7. Hi Sandro, this adapter works great. Thanx for your work. I noticed when used in conjunction with the biztalk deployment framework, the deployment fails because it seems to miss some kind of reference to Microsoft.BizTalk.Scheduler. Deploying or undeploying throws

    : error : Could not validate TransportTypeData, Address or Public Address properties for Receive Location ‘xxxxxxxx’. Could not load file or assembly ‘Microsoft.BizTalk.Scheduler, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified.

    I use BizTalk 2013 R2 Standard and BTDF 6.0. Do you have any clues?

    Thnx!

    Sander

    1. I am having the same issue. I read a few things online that said that you needed to manually add the Microsoft.BizTalk.Scheduler dll to the GAC. However, I have done that and I’m still getting the same error. Anyone have any ideas? I really like the adapter and would like to use it but the error it is causing in the deployment framework is a deal-breaker.

  8. Hi Sandro,
    I’m Using Schedule adapter in a BizTalk 2010 Clustered environment. The adapter works great on a standalone system but when i move the code to a clustered environment , the adapter sends the message and Hangs in teh Orchestration active state for days doing nothing. Eventually the admin has to terminate the orchestration. Could you help me in resolving this issue.

    Thanks
    vidyakumar

  9. where can i download 4.0 version? of this adapter.. i am trying to do a lift and shit of biztalk 2013 server.. the adapter version that i got is 6.0… and i have error because of this

Leave a Reply

Your email address will not be published. Required fields are marked *

BizTalk360
BizTalk Server

Over 500+ customers across
30+ countries depend on BizTalk360

Learn More
Serverless360
Azure

Manage and monitor serverless
components effortlessly

Learn More
Atomicscope
Business Users

Monitor your Business Activity in iPaaS
or Hybrid integration solutions

Learn More

Back to Top