i:0#.w|Ali.Mazaheri

Azure, Open Source, SharePoint and ...

Using Delay activity in WSS 3.0 custom Workflows (Lessons learned)

WF’s DelayActivity is best suited for scenarios such as sending Reminders or if you want to force your WF to dehydrate for a batch update on Item’s column(s), as you may know a .NET 3.0 hotfix or SP1 needs to be installed so that the Delay activity works.


Scenario:


You use DelayActivity and set the TimeoutDuration property to 5 minutes, after running the WF you notice that the Delay activity still does not work. In WSS 3.0, Delay activity gets triggered by a timer job (Job-workflow) which by defeat runs every 15 minutes and that explains why your WF instance never wakes up by Delay activity. Fortunately you can modify the setting for this timer job as you do not want to wait for 15 minutes while debugging your code! In order to change the default setting you need to run the following command: 


STSADM -O SetProperty -pn “Job-Workflow” -pv “Every 5 minutes between 0 and 59” -url [url of the Web application]


Note.


Make sure that you do not change this setting in Production environment as it may have some performance hit and use the above command only for debugging purposes in your Dev environment.