Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

SPD workflows and timer jobs

  Asked By: Ganesh    Date: Feb 23    Category: Sharepoint    Views: 13528

I need to start a workflow based on a status and a date in a list, not on adding
or editing a list. I can't find anything in sharepoint designer workflows that
will get a workflow to start this way, so I wrote a timer job to call up the
list everday. It seeems that this also will not work, so I am starting to think
I need to call the workflow directly from my timer job.

So I think my question is, can I call my workflow from my timer job, or does
anyone know of a better way to do this?

Share: 

 

15 Answers Found

 
Answer #1    Answered By: Siobhan Waller     Answered On: Feb 23

While you could likely write an event handler to do this (not sure, I'm no
coder), you could start  the workflow  and have it pause until your condition is
met. This could be done using Designer.

 
Answer #2    Answered By: Lorenzo Steele     Answered On: Feb 23

I can only get the workflow  to start  once when I use
the pause until activity.
I have also just discovered that updating the list  using a feature will not
kick off the workflow. It is hard for me to believe that updating a list using
the API will not fire a workflow, what is up with that.

I think I need to call  the spd  workflow from the code.

 
Answer #3    Answered By: Divakar Naik     Answered On: Feb 23

Your workflow  isn't firing? Do this:

site.WorkflowManager.Dispose();

I believe this will run the underlying workflows.

 
Answer #4    Answered By: Marcus Davis     Answered On: Feb 23

I have NEVER gotten a "pause until" or is it "wait until" workflow  to work  in
any way whatsoever. I gave up trying a year ago. Am using SPD, on a MOSS site,
on custom lists.

 
Answer #5    Answered By: Perla Vang     Answered On: Feb 23

One of the big problems with any of the workflow  pause commands is that they
aren't very precise. When a pause is encountered the workflow goes to
sleep. When the pause expires a job  is added to the timer  service that will
wake the workflow up. The problem usually is that the default timing on the
timer service is 5 minutes, so the job to wake up the workflow happens
sometime within 5 minutes or so after the condition that restarts after the
pause. Most people don't wait that long in testing and simply assume it
doesn't work.

 
Answer #6    Answered By: Sandra Alexander     Answered On: Feb 23

Let me try to explain better. I have a field called
assigned to and one called startdate. I have a sharepoint  designer workflow  with
start  when startdate = today email assigned.

Pause will not work  because I can't set the field, so all workflows  have to go
off at the same time.

I set startdate to be tomorrow, that was three days ago, and the email has not
come yet. I have passed the 5 minute time frame.

Let me ask this, is there a way I can wake up the SPD workflow from a custom
timer job?

 
Answer #7    Answered By: Nalin Rao     Answered On: Feb 23

The problem is that there is no way to update the value for today in your
equation while a workflow  is asleep. It will go to sleep with the today = the
current date  and today won't change until the workflow wakes back up. Which in
this case is never. Here's how you would need to design it.

1) Fire the workflow on each item as the item is created. Each item will get
its own instance.

2) Set a Pause until Date action with the date equal to startdate

3) When the workflow wakes up on startdate after the pause (remember this is +-
5 to 10 minutes) send the email

 
Answer #8    Answered By: Thomas Davis     Answered On: Feb 23

Yep, using the pause with a timer  job worked. Emails showed up right at 12:00.

 
Answer #9    Answered By: Dominic Davis     Answered On: Feb 23

Your welcome. I'm glad it worked out.

 
Answer #10    Answered By: Indu Raj     Answered On: Feb 23

I forgot to paste this in the email. This is a NOTE from the Office Online
documentation on how to use variables in workflows.

* Note When storing data in a variable, make sure that the variable always
refers to a value that holds the most current data (such as a field in a list),
especially when you use a delay action (Pause for Duration or Pause Until Date),
a wait action (Wait for Field Change in Current Item), or a task action (Assign
a Form to a Group or Assign a to-do Item). A variable will not refresh
automatically if the data has changed while the workflow  was paused, so it is
important to make sure that the variable is always linked to a data source that
holds the most current value.

See the highlighted phrase. Today in your case is the same as a variable. You
can find  the entire article here:

office.microsoft.com/.../HA102404151033.aspx

 
Answer #11    Answered By: Khushi Srivastava     Answered On: Feb 23

I use it to send nag emails when a due date  has passed. I also have used it as a
tasks list  reminder to calculate the number of days since assignment. 'Pause for
Duration' absolutely works.

 
Answer #12    Answered By: Arti Patel     Answered On: Feb 23

This is one of the most useful scenarious for an event handler. You would watch
for an update event that meets your condition. If you've deployed a timer  job
solution, you can get an event handler solution developed. This is the route I
would recommend if you comfortable with development.

 
Answer #13    Answered By: Claire May     Answered On: Feb 23

Take a look at the following blog post on how to start  a workflow
programmatically.


www.tonytestasworld.com/.../Howto-Start-a-Sharepoint-Work
flow-Programmatically.aspx

 
Answer #14    Answered By: Dan Dickerson     Answered On: Feb 23

Workflows are normally triggered on item creation or change. Could you throw
some more light on your scenario?

 
Didn't find what you were looking for? Find more on SPD workflows and timer jobs Or get search suggestion and latest updates.




Tagged: