How to schedule workflows (e.g. start every day at 2pm)

J

Jonas Knaus

Hi there

I am very new to the Workflow Foundation and I am wondering if the WF
has built-in scheduling components. I would like to have a workflow that
starts every day at 2pm as an example. Is it possible to host such a
workflow in a windows service and to have a configuration file that can be
used to configure the start time?

Or should I use a general scheudling component (like the one provided
with the OS) to start the workflows at the defined time?

I had a look at the WorkflowSchedulerService class, which provides the
protected method Schedule, but I was not able to use it properly.

It would be great if someone could try to point me into the right
direction!

Thanks a lot!
Jonas
 
D

David Browne

Jonas Knaus said:
Hi there

I am very new to the Workflow Foundation and I am wondering if the WF
has built-in scheduling components. I would like to have a workflow that
starts every day at 2pm as an example. Is it possible to host such a
workflow in a windows service and to have a configuration file that can be
used to configure the start time?

Or should I use a general scheudling component (like the one provided
with the OS) to start the workflows at the defined time?

I had a look at the WorkflowSchedulerService class, which provides
the protected method Schedule, but I was not able to use it properly.

It would be great if someone could try to point me into the right
direction!


If your workflows are short-running then hosting them in a console app that
is invoked by the OS scheduler should work fine. If they are long-running,
or you otherwise want to host them inside a Windows Service, then I would
add a simple WCF service hosted by your windows service, so a scheduled
console app can call into your windows service and kick off the workflows.

David
 
J

John Vottero

Jonas Knaus said:
Hi there

I am very new to the Workflow Foundation and I am wondering if the WF
has built-in scheduling components. I would like to have a workflow that
starts every day at 2pm as an example. Is it possible to host such a
workflow in a windows service and to have a configuration file that can be
used to configure the start time?

Yes, you could host the workflow in a Windows Service but, you have to write
the service. There's nothing like this built in to Windows workflow.
Or should I use a general scheudling component (like the one provided
with the OS) to start the workflows at the defined time?

You could do that too but, the Task Scheduler doesn't know anything about
Windows Workflow so you're not going to get things like persistence and
tracking. That means that a workflow that's waiting for an external event
won't survive a system reboot etc, etc.

You could also look at commercial task scheduler products like ours. We're
not shipping Workflow support yet but, we will be soon. I'm sure many other
companies are working on it too. If you would like to be a part of our
Workflow beta, send me an e-mail. If you would like more information about
JAMS, our job scheduler for Windows .NET, see http://www.mvpsi.com
I had a look at the WorkflowSchedulerService class, which provides
the protected method Schedule, but I was not able to use it properly.

That's for scheduling threads in a running workflow, not what you're looking
for.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top