Posts Tagged ‘ Scheduled Task Adapter ’

Setting up Scheduled Task Adapter

After I published a post to get the scheduled task adapter to work (by gacing the assemblies) I had someone ask me if I had a tutorial on setting up the properties for the adapter.  So here it is.
This is based on the previous version of the adapter not the lastest one.

Step 1: Create a receive location by creating a receive port or defining an existing receive port and choose the type to be “ScheduledTask” adapter

Step 2: Click on the configure button and click the Task Tab

Step 3: Click the FindTask button and then the browse to the location of the scheduled task dlls

Step 4: Select the Task Component dll

Step 5: Choose “XmlStringStreamProvide” and double click to populate “Assembly Qualified Type Name”

Step 6:Hit OK and “…” to bring up the XMLText Editor

Step 7: Type in the message that you want the adapter to put in the message box.  To generate this message, (if you have followed the solution architecture as outlined in Dan R’s book) you can generate an instance of the internal schema.  Hit ok..

Step 8: Click the schedule tab to specify the schedule.  There are various options, and in this example, I would be using weekly so that I can drop the message every day at 4:55 pm

Step 9: Choose XML Transmit pipeline and thats basically it.



Using Scheduled Task Adapter with BizTalk Server 2010

There is absolutely no documentation or may be very little associated with the Scheduled Task adapter on codeplex.  I will try to provide some tips and gotchas when using this adapter.  This is a very powerful adapter and I have used it in couple of my applications and used it to put raw xml in message box.

To use this adapter you will obviously have to install the adapter.  Unfortunately, it does not GAC a couple of assemblies even when you choose “everyone” on the install page.  To solve that problem I have created a MSI for installing the required assemblies into GAC.  You can download the installer from here.  Once the adapter is installed and the assemblies are GAC’d, you will have to follow general instructions on adding “ScheduledTask” as an adapter.  

Once the adapter is added, there are a couple of Gotcha to get the adapter working

1) After you have created the port, select the adapter, and click configure.  Provide a name.  This will be displayed as part of the URI on the port configuration page. 

2) Set the schedule

3) On the Task Tab, click Find Task.  #1) This page, if you are using the adapter for the first time, will be blank.  Click Browse and locate the directory where the adapter was installed (usually :<system drive:>\Program Files (x86) \ Biztalk ScheduledTask Adapter) and choose “ScheduledTaskAdapter.TaskComponents.dll” and click open.  Double click on the required stream provider (should populate the “Assembly Qualified Type Name” textbox and hit Ok.

4) This should populate the Class Text Box and would have “Task Properties” Populated with various properties.  Specify your text (in my case it was XML Stream and I put in raw XML) and hit ok.

5) You would think you are done. but no – #2) You will also have to add the “Biztalk.Adapter.ScheduledTaskProperties.dll” as a resource to your application and select the Gac’ing options.

6) Occasionally you might see an exception in the event long

The adapter “Schedule” raised an error message. Details “Exception has been thrown by the target of an invocation.”

This indicates that the the assemblies are not gac’d or they are not picked up. If you have already run the MSI and have added the dll as a resource, you need to restart the Host Instance.  Another reason why you might see this error is because your host instance might be running in 64 bit mode.  Ensure that the host instance is running as 32 bit.