locked
Issues With Delay Activity RRS feed

  • Question

  • Has anybody had any success using the Delay activity within Visual Studio authored workflows?

    Whenever I include a Delay activity in my workflows the workflow goes to sleep and never wakes up. If I listen for a Delay activity along with other events inside a Listen activity, I find that the other events (for example, OnTaskChanged) cause the workflow to be rehydrated as expected but the Delay activity does not. It doesn't seem to make any difference what the TimeoutDuration is set to or whether it's set statically in the designer or dynamically inside an InitiializeTimeoutDuration method.

    Does anyone have some sample code with Delay activities working correctly?
    Sunday, January 28, 2007 6:25 AM

Answers

All replies

  • I am having the same issue with this ... does anyone have any idea how to go around this issue? or is it just me not using it proper. I have a delay activity with a code activity before  and after. I am using ASP.net and ManualWorkflowScheduler. The code reaches the delay activity , fires off the initialize timeowtduration and then goes to sleep. The rest of the code never gets executed.
    Friday, February 9, 2007 8:28 PM
  • This is a bug in workflow runtime. Microsoft has produced a quick fix (System.Workflow.Runtime.dll) for it and the DelayActivity works fine with it, but I have no idea when it will be available for public.

     

    Friday, February 9, 2007 10:09 PM
  • Sergiy,

    Just out of curiosity, do you have any more information on the fix and how did you get your hands on it?

    rnellis2002

    Wednesday, February 14, 2007 5:21 AM
  •  Delay activity in RTM version doesn't fire when used with Sharepoint because of a bug in delay activity. Please refer following links.

    a. http://blogs.msdn.com/sharepoint/archive/2006/11/18/developing-workflows-in-vs-part-1-workflow-objects-and-a-crash-course-on-mechanics.aspx#1242927 (Eliene   Hao, whose Program Manager in Sharepoint Workflows, confirms that it’s a bug and that Microsoft is working on hotfix for it)
    b. http://www.eggheadcafe.com/software/aspnet/28654504/re-delayactivity-in-a-wo.aspx
    c. http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=980866&SiteID=1
    d. http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=994867&SiteID=1
    e. http://www.novolocus.com/display.php?id=331&backName=Index&backURL=index.php%3Fpage%3D1%26cat%3Dmicrosoft.workflow%23331

     

    Call Microsoft PSS for -KB929816-X86

    Friday, February 16, 2007 12:26 AM
  • So, I obtained the fix thanks to the Enterprise Go people - PSS couldn't help, YMMV - and Delay now works. Sort of.

    I set up a delay to repeat every ten minutes in an infinite loop. Watching the workflow history I can see the delay fire after maybe twenty minutes, then an hour, another time after maybe four or five hours. There doesn't seem to be much of a pattern to it.

    Is anyone else still having issues after installing the patch?
    Monday, February 26, 2007 12:43 PM
  • Where did you get the hot-fix?  I too called PSS and they had no idea.
    Wednesday, February 28, 2007 9:56 PM
  • I had to contact the Enterprise Go programme support people.
    Thursday, March 1, 2007 7:13 AM
  • Are you having any problems with it?  I contacted Microsoft Support for it and they said the hot fix was released but had been pulled because of some issues.  I really need this fixed and still don't even have an ETA on when it will be available.
    Friday, March 16, 2007 1:24 PM
  • I can't vouch for the Share Point, but I've had success with delay timers hosted in asp.net work flows. If you're using a the ManualWorkflowSchedulerService you need to set the UseActiveTimers=true or construct it like so: ManualWorkflowSchedulerService  foo = new ManualWorkflowSchedulerService(true);
    Good luck with the SharePoint issues.

    Cheers,
    homertbush
    Tuesday, March 20, 2007 12:40 AM
  • The QFE is released by Microsoft and we're now using it.  So far so good.  You still have to contact MS support to get it though as it has not been through full regression testing yet.

    Tuesday, March 20, 2007 5:05 PM
  • Hi all,

     

    I am developping (for a client) a custom approbation sequential workflow in a Sharepoint site (MOSS 2007). I have to use the Delay Activity, and as you guess, my workflow doesn't reload at all after the delay.

    I have retrieved the Windows Workflow Foundation "KB929816" hotfix and installed it, but it doesn't solve my problem... (I checked if the dlls were correctly patched and that's ok)

     

    Did somebody succeed to use the delayactivity in a Sharepoint site? Is there something special to do?

     

    PS : For your information, MOSS 2007 uses its own persistence service (SPWinOePersistenceService) and I doesn't seem to be configurable...

     

    Thanks for any reply

    Friday, April 13, 2007 4:17 PM
  • It's working for us.  We had to install Windows Server 2003 SP2 though.  Without SP2 it didn't work.

    Friday, April 13, 2007 4:21 PM
  • Thank you for your reply

    I have installed the SP2 and it works now!

     

    The strange thing is that the SP2 is not in the prerequities in the KB article...

     

    Hope I won't have more problems on the delay activity

     

    Thank you again for the infos!

     

     

     

    Monday, April 16, 2007 10:00 AM
  • Glad it solved your problem.
    Monday, April 16, 2007 12:01 PM
  • After installing "KB929816" hotfix and several server rebootings everything works as it should - one minute delay could wake up after 2 -15 minutes.
    Tuesday, April 17, 2007 7:08 AM
  • Hi Joe,

     

    I have created a workflow with delayActivity within the while activity. Previously the delayActivity was not worked.

    After installing the hotfix "NetFX30-KB932394-X86.exe", which is downloaded from

    http://www.microsoft.com/downloads/details.aspx?FamilyID=6096ce0f-d21e-47ac-afe2-d4e1c2fce670&displaylang=en

     the delayActivity working, when i enter 10sec. But actually the delayActivity is not wakingup after 10 sec, rather its waking up for every 1 min. Then i changed the timeout duration to 2 min, then the timer is not wakeing up till 15 min.

     

    After long serach only i found this problem in this forum.

    Then i immediately installed Windows Server SP2.

    After installing the SP2 also the delayActivity is not working properly.

     

    I'm facing this problem almost a month. Still  i'm not able to solve this. Please let me know what else i have to do, to solve this problem.

     

     

     

    Thanks and Regards,

    Vinothkumar B

    bvinoth@tvsinfotech.com

    Thursday, May 31, 2007 1:49 PM
  • Maybe try re-installing the hotfix after installing SP2?

     

    The delay will fire based on the interval of the Windows SharePoint Services Timer Service (owstimer.exe).  You can check the interval using the following command:

     

    >stsadm -o getproperty -propertyname "job-workflow" -url http://localhost

     

    To set the interval, use the following command:

     

    >stsadm -o setproperty -propertyname "job-workflow" -propertyvalue "every 5 minutes between 0 and 59" -url http://localhost

     

    Basically what happens with a delay activity is the workflow is persisted to the database, and the next time the timer interval occurs, it checks the workflow to see if it is still in a pending state (ie. waiting for delay activity to expire) or if it is ready to run again.  If the delay activity has expired, then your workflow will continue.  This means that if your workflow is set with an interval of 15 minutes and you start your workflow at 7 minutes after the hour and it hits a 1 minute delay it will take approvimately 8 minutes to wakeup and continue instead of 1.

     

    Hope that helps.

     

    Joe

     

    Thursday, May 31, 2007 3:58 PM
  • Not sure if this is related but i thought i'd throw it out there in case it could help.

    http://www.microsoft.com/downloads/details.aspx?FamilyID=6096ce0f-d21e-47ac-afe2-d4e1c2fce670&displaylang=en
    Friday, June 1, 2007 8:03 AM
  • Hi,

     

    Thank you for explanation. You mention that the workflow is persisted to the database. I am having problems with a production SharePoint 2007 server with uses a SQL 2000 server in which SP2 and the NetFX30-KB932394-X86 were installed. The workflow will just don't resume. I did the same in my development environment and it works marvellous, but I am using SQL 2005. Do you think, this could be an issue? or something else?

     

    I hope you can help me.

     

    Thanks,

     

    Edgardo

    Tuesday, July 10, 2007 2:52 PM
  • I'm also experiencing the problem. I've installed Windows 2003 Server SP2 and the hotfix, but this didn't do anything.

    I have a pretty basic workflow: a WhileActivity which loops infinitely with a Delay activity set for 5 seconds inside. If no persistence is involved, it works like a charm. But if the default sql persistence service is used, after the workflow gets persisted (when it hits the delay activity) it seems to wake up at random and LONG time intervals, certainly longer than the 5 seconds I specified (maybe in the range of minutes or 10's of minutes). This, of course, makes my workflow useless.

     

    Any other ideas how this could be fixed? (maybe some remarks from MS people with "inside" information)

    Friday, August 31, 2007 12:20 PM
  •  

     

    You are applying the wrong hotfix.  You're right, I've tried that one as well and it doesn't fix the issue.

     

    You need to be using one of:

    - NetFX30-KB932816-X86.exe (x86)

    - NetFX30-KB932816-X64.exe (x64)

     

    Here's the link to the KB article in which it even says that this hotfix replaces the one in KB932394.

     

    http://support.microsoft.com/kb/932816

     

    Hope that helps,

    Joe

     

    Tuesday, September 4, 2007 12:49 PM
  •  

    Hi Joe,

     

    Hopefully the hotfix you mentioned work for Adrian, but we installed, uninstalled and reinstalled both Hotfixes and no positive results. Until now Microsoft has not been able to deilivery a solution. The worst of all is that the bug seems to be not consistent. I have test environments where the hotfixes work and in other environments workflows are never rehydrated.

     

    I hope Microsoft gets this issue working. We already lost a big client for this reason.

     

    Edgardo

    Tuesday, September 4, 2007 3:24 PM
  • Try this to force SharePoint to "wake up and check Delay activities" more often (than the default of 5 minutes):

     

    stsadm -o setproperty -pn job-workflow -propertyvalue "every 1 minutes between 0 and 59" -url http://yourservernamehere

     

     

     

     

     

    Tuesday, September 4, 2007 7:58 PM
  •  

    Thank you Fred, but will tried that also and it didn't work
    Tuesday, September 4, 2007 8:05 PM
  • I called MS, got the hotfix, left the test app running overnight (test app = simple sequential workflow containing a WhileActivity with a Delay in it, configured for persistence, so nothing to even do with Sharepoint) and it doesn't work.

     

    Again, you have to take into account that the Delay activity itself (or the timer subscription mechanism within WF) seems to be broken, because it doesn't even work in "normal", non-Sharepoint workflows.

     

    Sad

    Wednesday, September 5, 2007 6:22 AM
  • Not sure what to tell you ... we've got it working in SharePoint with the hotfix on 5 Windows Server 2003 R2 SP2 x86 development laptops, as well as 4 Windows Server 2003 R2 SP2 x64 servers (2 production, 1 pilot, and 1 dev) and 1 Windows Server 2003 R2 SP2 x64 development PC.

     

    Process I'm following for setup, is as follows:

    - Install Windows Server 2003 R2 SP2

    - Install all updates from windows update

    - Install SQL Server 2005 and all patches (if it's running on the same server, our production, pilot, and dev servers run SQL separately)

    - Install Windows SharePoint Services

    - Install the hotfix

    - Configure SharePoint

     

    That's pretty much it.

     

    Best of luck,

    Joe

     

     

    Wednesday, September 5, 2007 7:31 AM
  • I am still facing some inconsistency in the result (some workflow instances can get till the end but some not for the same workflow) after intalling patches from Microsoft. Basically i tried out two patches, KB932394 and KB929816.

     

    Base on my experiment, KB932394 patch churned out a more consistent result than KB929816 patch. I am using Windows 2003 Standard Edition with Service Pack 2.

     

     

    Tuesday, September 11, 2007 2:29 AM
  • Hello again,

     

    Just to update my last post in this forum. Strangely or not, the workflows worked perfectly when used on sites on a different port. For example, WF's that didn't work on sites in Port 8000/8080 worked perfectly in Port 80.

     

    System configuration:

     

    W2003K SP2 x86 Server

    MOSS Standard

    SQL 2000 Server

    Both hotfixes installed

     

    Please tell Microsoft!

     

    Hope it helps!

     

    Edgardo

     

    Wednesday, September 12, 2007 12:12 PM
  •  All,

    I posted this on another thread in this forum (didn't see this one until today)

    LINK : http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2000437&SiteID=1

     

     

    I spoke with someone from MS regarding this issue and he sent the below follow-up email to me today.

     

    "I have been able to set up some local tests on my machine to narrow down the problem and have had a talk about this with the product group as well. The issue happens if the Delay is inside a replicator, there are many delays running in parallel, or if DelayFor is the last activity in a workflow, using just a delay activity in a workflow works fine.

     

    The product group is aware of these issues and is looking into all these scenarios. As of right now I [do] not have any time lines for a fix or an update, it could take a while to have a public fix available. I am the owner of this bug [and] will keep monitoring this issue and watch for updates..."

     

    If you can tweak your setup so that it doesn't fall in to the above scenarios, it may work, otherwise, I ended up using a regular Delay Activity which has the following settings: TimeoutDuration which is in the format of DD:HH:MM:CC (The CC is seconds b/c the SS caused a smiley ).  So, the following would be 50 days, 40 hours, 30 minutes and 00 seconds: 50.40:30:00.

     

    Instead of using the DelayUntil, try using a regular delay.  I took the DATETIME of today and subtracted it from DATETIME of 'your date' and converted it into Days,Hours,Minutes, & Seconds.

     

    Example:

    DateTime dtReminder1 = Convert.ToDateTime(workflowProperties.Item["Reminder 1 Date"]); // gets datetime from a field named 'Reminder 1 Date'
    TimeSpan tsDiff = dtReminder1.Subtract(dtToday); // subtract today from 'Reminder 1 Date'
    Double dblDays = tsDiff.Days; // get days
    Double dbltemp = tsDiff.Hours; // store total hours into temp variable
    Double dblHours = dbltemp % 24; // extract days (24 hours/day) from tsDiff, so you are left with just the hours

    Double dbltemp2 = tsDiff.Minutes; // store total minutes into temp2 variable

    Double dblMinutes = dbtemp2 % 60 // extract minutes (60 mins/hour) from tsDiff, so you are left with just the minutes

     

    You are left with the following:

    dblDays = # days, dlbHours = # hours, dlbMinutes = # of minutes.

     

    Instead of using the DelayFor, try using the regular delay.  This is allready set to use Hours Minutes and SEconds, so instead of using three settings (days, hours, minutes), convert into one string 00.00:00:00.

     

    Hope this helps! [otherwise we have to wait until a fix is released]

    Jonathan K. Herschel

     

    Wednesday, September 12, 2007 2:52 PM
  • I'm still having trouble with this. I'm on Server 2003 SP2, MOSS 2007 SP1, installed the hotfix, restarted the server, ensured the DLLs are the correct version in the fix, created a test delay workflow and it still stalls. I'm at my wits end.

     

    Any help is very much appreciated.

     

    Thursday, February 7, 2008 7:11 PM
  • There is a new patch out that is supposed to fix the issue...

    http://support.microsoft.com/kb/953630/


    Sunit
    Monday, August 18, 2008 5:39 PM
  • Is the delay issue definitely solved with this patch for state workflows? I'm still having problems with delay's that never wake up or wake up to soon?!!! For example the TimeoutDuration is set for 2h but workflow wakes up after 5 minutes (when MOSS timer job checks up).
    Monday, March 9, 2009 9:09 PM
  • Looks like the delay activity broke again... 

    This is what I am running:
    Win 2003 SP2 + latest updates
    MOSS/WSS SP2 + April 2009 Uber Updates
    .NET 3.0 SP2
    .NET 3.5 SP1

    Cannot get a simple workflow to work: Start -> Send Email -> Delay for 1 min -> Send Email -> End

    Workflow waits endlessly at the Delay Activity. Same WF runs like a charm on a test VPC that is unpatched and running older MOSS updates. Can anyone else confirm that the delay activity is broken again?
    Friday, September 4, 2009 3:11 PM
  • What is the value of your job-workflow property ?
    Did you restart the timer service ?

    http://technet.microsoft.com/en-us/library/cc424970.aspx
    Serge Luca; blog: http://www.redwood.be
    Friday, September 4, 2009 3:55 PM
  • Thanks for the reply Serge.

    Yes, the job-workflow property is set:

    <Property Exist="Yes" Value="every 5 minutes between 0 and 59" />

    I've tried restarting the SP Timer Service, IIS and even the server.
    Friday, September 4, 2009 5:01 PM
  • Just to isolate the potential problem of the sendmail, could you create a simple workflow with a while (from 0 to 5), a sequenceactivity hosting a delay (1 minute) and a logToHistoryList .
    I did it with MOSS sp2 and that worked.
    Check the History list to figure out if the delay works.


    Serge Luca; blog: http://www.redwood.be
    Friday, September 4, 2009 5:05 PM
  • Tried taking the sendmail out of the picture and created a new WF that only logs to the history list.  Still seeing the same problem. The WF logs to the history list right upto the call to the delay activity, but nothing after that. None of the subsequent logToHistoryList activities are called.

    I've also updated the MOSS server to the latest Aug 2009 (v12.0.0.6514) updates but still no luck.

    I've checked the Workflow table in the config database and I can see the DeliveryDate for the scheduled items set to fire after the delay activity finishes, but as soon as that time passes, the DeliveryDate gets updated to some future time (anywhere from 5 mins to few hrs in the future) and that keeps happening and that scheduled job is never executed.

    I've checked the ULS logs and I don't see any exceptions in there, except a Info msg that the scheduled job was postponed. The msg is of the type:
    Scheduled timer job Workflow, id {84CC71C0-7224-41DE-92B7-C0E7043E196C} at 08 Sep 2009 09:40:07 -0400 (now is 08 Sep 2009 09:35:07 -0400)

    Tuesday, September 8, 2009 5:49 PM
  • Hi all,
    this issue really seems to be difficult to solve. We are experiencing similar problems at a customer of our. However, the workflow delay does not stop forever, it does resume, but not always after the time that has been set.

    Windows 2008 SP 1
    SharePoint Server 2007 SP 2
    .NET FX 3.5 SP 1

    We are using a delay in a while activity (While continue=false --> delay) and have seen that the workflow sometimes only wakes up after 10 minutes, 20, 25, ... at the very beginning it seems to occur earlier... at a later stage (i.e. workflow has been running for a longer time already), the delays seem to take longer, sometimes 20 hours (while at the beginning there seems to be a predictable delay, at a later stage it is sometimes totally out of logic).

    Any more ideas on how to solve this thing?

    Best regards,
    Alex

    ECSpand Services for your SharePoint - Find out more at www.ecspand.com
    Thursday, November 26, 2009 12:24 AM
  • Hello,

    whats about this issue? It is solved? I've the same issue in my workflows. I've set the timer intervall to one minute (stsadm -o setproperty ...). Sometimes the timing and the entry in the table ScheduledWorkItems is correct but a lot of times the wake-up time is wrong.
    When I correct manually the ScheduleWorkItems entries the owstimer event occured.

    My test installation:
    Windows Server 2003
    SharePoint + Latest Updates
    .NET 3.5 + SP1

    Does anyone have an idea to solve this issue?
    -
    Sunday, January 17, 2010 5:05 PM
  • Hello,

    I have the same configuration as hsd31 :

    Windows 2003 Standard Edition SP2
    .NET 3.5
    MOSS/WSS SP2

    and i still have problem with delayActivity

    please is there any issue with it?
    • Proposed as answer by lyzavala Wednesday, March 31, 2010 9:44 PM
    Wednesday, February 10, 2010 4:26 PM
  • We have a Premium call open with MS since November 2009 - they have been able to reproduce the problem in January, but the product group still hasn't found the root cause of it. Hence, our case is still pending. Unbelievable, but true. If the case will have been solved some day, I will let you guys know.

    Maybe it helps if you guys contact Microsoft and refer to case SRQ091204600462 (that is our case that describes exactly that problem).


    ECSpand Services for your SharePoint - Find out more at www.ecspand.com
    Thursday, April 1, 2010 6:43 AM
  • any update on this?

    Wednesday, May 12, 2010 9:29 PM
  • I can't get this working after updating my win 2k8 server running moss sp2/ wss 3.0 sp2 and .net 3.5 sp1. What is the deal with this? I have tried everything and nothing works in getting the delay to fire. The delay activity is a critical component of development inside of workflows - and it seems to be completely non-functioning in 2007. Is this fixed in 2010? How can Microsoft not be all over this?
    Monday, June 28, 2010 6:42 PM
  • Believe it or not, but our support request has been closed. Solution: none.

    If you talk to Microsoft, use our reference number SRQ091204600462 for details. They have been trying to find and fix the problem, but they were unable to pinpoint the issue. They told us that it is not 100% and always reproducable.

    <quote>

    Same as the product group, I am not able to reproduce the issue with your SPD workflow “Loop With Delay Test”. I did these new series of tests on three different platforms. You will find below a description of all these three platforms. We do think that the issue is related to the repro platform’s configuration. Unfortunately we are not able to figure out how to “properly” configure it. I had a talk with Rares and he doesn’t have his former test platform anymore. Nevertheless this potential repro would not have been enough for the product group to be able to provide a solution, please see below for more information.

     

    I am still able to randomly reproduce a similar issue with my visual studio workflow test solution. Nevertheless the product group cannot take this repro scenario into account as the delay appears randomly, there is no event logged when the delay is added. The VS scenario doesn’t fully correspond to your SPD scenario.

     

    The product group’s decision is that it is too risky to modify the current default workflow platform behavior without a clear repro platform and scenario. This request cannot be handled through the request for hotfix process. This request requires more researches and testing, and at the ending result could deeply affect the whole workflow platform stability. We don’t want to take the risk to destabilize the workflow platform.

    </quote>

    If anyone has a 100% always-reproducable situation, I'll be happy to forward this to the product group under this request.

    I am, too, still quite disappointed and angry about this situation.


    ECSpand Services for your SharePoint - Find out more at www.ecspand.com
    Monday, June 28, 2010 8:08 PM
  • I am having issues with the Delay not working consistantly.  I have an open ticket as well, it occurs on 2007 AND 2010 and it happens for me in all environments I build.  Open a ticket with MS if you see this...they need more help fixing this bug.  They will not charge if it is a bug....
    Tuesday, August 3, 2010 12:18 AM
  • I'm locking this thread as it has now reached a completely uncontrollable state (almost 50 posts) and we've even started getting SP 2010 comments (deleted) in it.

    Moderator pre-SP 2010 forums

    If anyone still has problems with this (and is using a pre-SP 2010 product) they should start a new thread.

     


    SP 2010 "FAQ" (mainly useful links): http://wssv4faq.mindsharp.com/default.aspx
    WSS3/MOSS FAQ (FAQ and Links) http://wssv3faq.mindsharp.com/default.aspx
    Both also have links to extensive book lists and to (free) on-line chapters
    Monday, June 27, 2011 7:40 PM