Tuesday, February 01, 2005

Orchestration Scheduler

A nifty way of forcing activation of an orchestration at a given time is to use the SQL adapter to poll a table, in combination with a service window that restricts the poller to fire only once per day.

Create a table that contains any information you might want in your orchestration (i.e. the command message data), then create a SQL receive location that polls this table once a day, and set the service window to open at the time you want the orchestration to fire.

If you set the service window to start and stop at the same time, it is actually open for one minute - the start opens the window at hh:mm:00 and the stop ends the window at hh:mm:59, so as long as you set the poller frequency to > 1 minute, it will only fire once per day.)

You can put all sorts of information in the table, and build up quite complex schedules, even forcing multiple orchestrations to start thereby implementing a multi-threaded scheduler. This also allows you to keep track of the last time a poller was started. It's potentially quite a powerful technique.

3 comments:

hung said...

Can I have the source code for this polling?
It is easier to understand if you can give the code in a BT 2004 project.
Thanks!

hung said...

Can I have the source code for this polling?
It is easier to understand if you can give the code in a BT 2004 project.
Thanks!
HungLukeNguyen@yahoo.com

Hugo Rodger-Brown said...

Hung - Unfortunately I don't have a sample to hand.