﻿<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://developers.de/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>ManualWorkflowSchedulerService and DelayActivity</title><link />http://developers.de/blogs/damir_dobric/archive/2007/12/10/manualworkflowschedulerservice-and-delayactivity.aspx<description>While implementing Windows Workflow (WF) applications, there are situation when the workflow has to be scheduled manually. By default one workflow is scheduled by using DefaultWorkflowSchedulerService . Additionally to default scheduler, Windows Workflow</description><dc:language>en</dc:language><generator>CommunityServer 2008 SP1 (Build: 30619.63)</generator><item><title>re: ManualWorkflowSchedulerService and DelayActivity</title><link />http://developers.de/blogs/damir_dobric/archive/2007/12/10/manualworkflowschedulerservice-and-delayactivity.aspx#329376<pubdate>Sat, 08 Sep 2012 23:50:15 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:329376</guid><dc:creator>http://www.louisvuittonreplicago.com</dc:creator><description>&lt;p&gt;This has been quite &amp;nbsp;open-handed of people like you to offer freely what exactly many people could possibly have supplied as an electronic book to get some profit for themselves, chiefly seeing that you could possibly have done it in the event you decided. The tactics as well acted to provide a good way to be sure that the rest have the identical dream the same as my personal own to find out very much more pertaining to this condition.&lt;a rel="nofollow" target="_new" href="http://www.louisvuittonsau.com"&gt;http://www.louisvuittonsau.com&lt;/a&gt;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=329376" width="1" height="1"&gt;</description></item><item><title>re: ManualWorkflowSchedulerService and DelayActivity</title><link />http://developers.de/blogs/damir_dobric/archive/2007/12/10/manualworkflowschedulerservice-and-delayactivity.aspx#1998<pubdate>Mon, 23 Jun 2008 15:56:27 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:1998</guid><dc:creator>Damir Dobric</dc:creator><description>&lt;p&gt;:)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1998" width="1" height="1"&gt;</description></item><item><title>re: ManualWorkflowSchedulerService and DelayActivity</title><link />http://developers.de/blogs/damir_dobric/archive/2007/12/10/manualworkflowschedulerservice-and-delayactivity.aspx#1997<pubdate>Mon, 23 Jun 2008 15:50:51 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:1997</guid><dc:creator>garrone</dc:creator><description>&lt;p&gt;Hi! :) &lt;/p&gt;
&lt;p&gt;I have found a way to solve that issue. I had to inherit the WorkflowSchedulerService base class. The only 2 methods needed to be overriden are the `Schedule` ones. The first one is called when the workflow is started - which is executed in one of my threads as the workflow is started from there, and the second one (which provides a callback method) is executed in workflow runtime thread, but as I can get my own thread pool and start the execution of the rest of the workflow in it. &lt;/p&gt;
&lt;p&gt;Both links were helpful! :) Thanks again. &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1997" width="1" height="1"&gt;</description></item><item><title>re: ManualWorkflowSchedulerService and DelayActivity</title><link />http://developers.de/blogs/damir_dobric/archive/2007/12/10/manualworkflowschedulerservice-and-delayactivity.aspx#1983<pubdate>Fri, 20 Jun 2008 09:36:36 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:1983</guid><dc:creator>Andreas Erben</dc:creator><description>&lt;p&gt;regarding my previous comment to garronne....&lt;/p&gt;
&lt;p&gt;I see you used UseActiveTimers... my comment did not take that into consideration. &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1983" width="1" height="1"&gt;</description></item><item><title>re: ManualWorkflowSchedulerService and DelayActivity</title><link />http://developers.de/blogs/damir_dobric/archive/2007/12/10/manualworkflowschedulerservice-and-delayactivity.aspx#1982<pubdate>Thu, 19 Jun 2008 16:49:33 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:1982</guid><dc:creator>Damir Dobric</dc:creator><description>&lt;p&gt;This could be helpful: &lt;a rel="nofollow" target="_new" href="http://developers.de/blogs/damir_dobric/archive/2008/06/19/about-manually-scheduling-and-persistance-of-workflows.aspx"&gt;developers.de/.../about-manually-scheduling-and-persistance-of-workflows.aspx&lt;/a&gt;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1982" width="1" height="1"&gt;</description></item><item><title>re: ManualWorkflowSchedulerService and DelayActivity</title><link />http://developers.de/blogs/damir_dobric/archive/2007/12/10/manualworkflowschedulerservice-and-delayactivity.aspx#1981<pubdate>Thu, 19 Jun 2008 16:39:47 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:1981</guid><dc:creator>Andreas Erben</dc:creator><description>&lt;p&gt;To garronne:&lt;/p&gt;
&lt;p&gt;It is difficult to guess about what might cause the additional threads to be created.&lt;/p&gt;
&lt;p&gt;Here is how I understood your scenario:&lt;/p&gt;
&lt;p&gt;You do manage your own thread pool, you do not use the .net thread pool at all.&lt;/p&gt;
&lt;p&gt;I wonder what your implementation does already.&lt;/p&gt;
&lt;p&gt;Are you sure you are not causing additional threads to be created by something else? what do you use in your workflows?&lt;/p&gt;
&lt;p&gt;If you use the manual scheduler service, then you execute on the thread that is actually running.&lt;/p&gt;
&lt;p&gt;Meaning, you need to look at the loaded workflows and run each of them individual from the specific thread you want it to run on.&lt;/p&gt;
&lt;p&gt;how do you start your persisted threads now?&lt;/p&gt;
&lt;p&gt;An interesting blog post in that context:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://codeidol.com/other/essential-windows-workflow-foundation/Applications/Running-a-WF-Program-Instance/"&gt;codeidol.com/.../Running-a-WF-Program-Instance&lt;/a&gt;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1981" width="1" height="1"&gt;</description></item><item><title>re: ManualWorkflowSchedulerService and DelayActivity</title><link />http://developers.de/blogs/damir_dobric/archive/2007/12/10/manualworkflowschedulerservice-and-delayactivity.aspx#1976<pubdate>Thu, 19 Jun 2008 09:29:46 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:1976</guid><dc:creator>garrone</dc:creator><description>&lt;p&gt;No, I think there's a misunderstanding: I have a thread pool with threads T1, T2, T3 which they will always &amp;quot;be there&amp;quot;. If the host is restarted, there will be another T1, T2, T3. I don't care if they are the same or not. I also don't care if the workflow was executed first on T1, then is scheduled on T2, as long as they are threads from my thread pool. They are just worker threads, and I want to avoid as much as I can the creation of new threads. The application need to be fast. On my test, the framework decides to create a new thread (T4). Assuming we have 100 threads in my thread-pool, and all of them are executing workflows which need to be persisted at some point, and then all of them are resumed at the same time, we end up having 200 threads instead of 100.&lt;/p&gt;
&lt;p&gt;I just want to know if it's possible to hook the `wake up` event and schedule on one of my own threads the resumed workflow.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1976" width="1" height="1"&gt;</description></item><item><title>re: ManualWorkflowSchedulerService and DelayActivity</title><link />http://developers.de/blogs/damir_dobric/archive/2007/12/10/manualworkflowschedulerservice-and-delayactivity.aspx#1975<pubdate>Thu, 19 Jun 2008 08:52:19 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:1975</guid><dc:creator>Damir Dobric</dc:creator><description>&lt;p&gt;I’m concerned about that design, because:&lt;/p&gt;
&lt;p&gt;1.	When the WF is persisted on Thread T1. What should happen with that thread as long the WF is in persisted state. To keep it opened is not a good idea. If you abort it, you will never again be able to do reload anything in that thread, because it does not exist anymore.&lt;/p&gt;
&lt;p&gt;2.	What when the host is started again? The there is no thread which has previously hosted persisted WF.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1975" width="1" height="1"&gt;</description></item><item><title>re: ManualWorkflowSchedulerService and DelayActivity</title><link />http://developers.de/blogs/damir_dobric/archive/2007/12/10/manualworkflowschedulerservice-and-delayactivity.aspx#1974<pubdate>Thu, 19 Jun 2008 08:24:22 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:1974</guid><dc:creator>garrone</dc:creator><description>&lt;p&gt;Yes, I am using manual-scheduler to start the workflows. My problem is after the workflow is persisted into db, and then it need to be `waked` up - the scheduler uses another thread than from my thread-pool. I want to decide on what thread the revived workflow should be executed.&lt;/p&gt;
&lt;p&gt;This behaviour looks similar with default-scheduler, but my problem is I want to manage the waiting-queue too (it has to be stored on db, etc).&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1974" width="1" height="1"&gt;</description></item><item><title>re: ManualWorkflowSchedulerService and DelayActivity</title><link />http://developers.de/blogs/damir_dobric/archive/2007/12/10/manualworkflowschedulerservice-and-delayactivity.aspx#1970<pubdate>Wed, 18 Jun 2008 21:55:39 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:1970</guid><dc:creator>Damir Dobric</dc:creator><description>&lt;p&gt;If you redehydrated persisted workflow on the same thread it was running at the moment of persisting, the you can run it on the same thread by using of manual scheduler service.&lt;/p&gt;
&lt;p&gt;However, this scenario seems to be a bit unusual, because theoretically it will and should never &amp;nbsp;be the same thread. Persistence is also done for purpose of keeping of WF session state and it should survive host crash. What will you do if the host is restarted and WF then redehydrated . In this case there is even no theoretical solution.&lt;/p&gt;
&lt;p&gt;Hope this helps...&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1970" width="1" height="1"&gt;</description></item><item><title>re: ManualWorkflowSchedulerService and DelayActivity</title><link />http://developers.de/blogs/damir_dobric/archive/2007/12/10/manualworkflowschedulerservice-and-delayactivity.aspx#1969<pubdate>Wed, 18 Jun 2008 21:06:01 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:1969</guid><dc:creator>garrone</dc:creator><description>&lt;p&gt;I have read your article, and it does sounds interesting. However, I have a problem which seems to be close to what you wrote here, and you might have an ideea an give me a hint:&lt;/p&gt;
&lt;p&gt;I have an Application which hosts a thread pool which is supposed to run some sequential workflows. I am using ManualWorkflowSchedulerService(true). My problem is that when some workflow is &amp;quot;persisted&amp;quot;, when waked up, it runs into a different thread - other than the ones from my thread pool. Is there any way I can &amp;quot;force&amp;quot; the runtime to pick one thread from my own thread pool?&lt;/p&gt;
&lt;p&gt;Bests.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1969" width="1" height="1"&gt;</description></item><item><title>re: ManualWorkflowSchedulerService and DelayActivity</title><link />http://developers.de/blogs/damir_dobric/archive/2007/12/10/manualworkflowschedulerservice-and-delayactivity.aspx#1859<pubdate>Thu, 03 Apr 2008 06:30:47 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:1859</guid><dc:creator>Damir Dobric</dc:creator><description>&lt;p&gt;Be also aware of this: &lt;a rel="nofollow" target="_new" href="http://support.microsoft.com/kb/821268"&gt;support.microsoft.com/.../821268&lt;/a&gt;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1859" width="1" height="1"&gt;</description></item><item><title>re: ManualWorkflowSchedulerService and DelayActivity</title><link />http://developers.de/blogs/damir_dobric/archive/2007/12/10/manualworkflowschedulerservice-and-delayactivity.aspx#1853<pubdate>Tue, 01 Apr 2008 14:06:13 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:1853</guid><dc:creator>Damir Dobric</dc:creator><description>&lt;p&gt;I would also recommend this article: &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/advancedworkflow/archive/2006/04/25/583392.aspx"&gt;blogs.msdn.com/.../583392.aspx&lt;/a&gt;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=1853" width="1" height="1"&gt;</description></item></channel></rss>