Windows Workflow Foundation (WF4) - Workflow Services and Auto-Start
This sample application demonstrates how you can create a Workflow Service that will automatically start and periodically wake up to do some work. The sample also demonstrates a UI that shows the progress of the work and provides control and query capabilities.
Hi Ron, great blog and great examples!
I have some questions about your example... Lets imagine that instead of just counting and sleeping in main work brunch we do some "real" job and activity that doing the job takes some time for execution (lets say couple minutes). What will happen in this case? Will it be possible to get access to Query branch when the activity is working? Or it will will be blocked because of one thread? What if activity is asynchronous, will your example continue working? What is your suggestion if it's necessary to do some long running activities in the loop and control the number of that amount of job already done (some king of progress bar)?
If your worker activities are I/O bound rather than CPU bound be sure to build them using AsyncCodeActivity. This will allow the workflow to access the Query branch even when work is going on. Another option would be to simply call a service (using Async calls) that sends the work somewhere else. Be sure to take a look at the blog series I wrote on WF4 and Task Parallelism (http://blogs.msdn.com/b/rjacobs/archive/2011/06/28/the-workflow-parallel-activity-and-task-parallelism.aspx) for more.
XAMLX files are like .ASPX files. You don't have to have seperate config entries for them. You can have as many as you like. The XAMLX Workflow Service does have a configuration name property if you want to set this in order to use a <service> tag in the config file.
I try to modify the TraceBatchWork.cs to call my function to write a file to a folder. I get an "UnauthorizedAccessException" for "Access to the path is denied". So I grant a full permissions for IUSR and ASP .NET to the folder, but I still get an exception. Under the IIS Authentication, I saw the Anonymous Authentication is Enabled and the Specific user is "IUSR". Is there other account i should add to the folder?
Ron Thank you for your help. I find my problem, it is due to my application pool identities is ASP.NET v4.0 instead of DefaultAppPool. It work once I add the ASP.NET v4.0 to the Security of the folder. Please see the following link : http://learn.iis.net/page.aspx/624/application-pool-identities/
I can run the WEBBatch from my computer and it had updated the AppFabricMonitoringDB on the first day I run the program. Also I can see three autostart batch job running. However, today I start the program from the VS2010, I can Submit Batch and it will show up on the Submitted Jobs gridview. But it don't show up on the other two gridview and not update the AppFabricMonitoringDB. Am I broke the connections string?
I look at my Web Platform Installer 3.0 to find out that my Windows Server AppFabric Released on 7/23/2010, since I install the AppFabric through the Web Platform Installer. Other than that I cannot find any version number from the App. Would you mind to point me where I can find the Version number.
I see the BatchWorker will write the data to the database AppFabricPersistenceDB when i submit the batch and it will delete the record after it done, but it won't write to AppFabricMonitoringDB. Also I get the following error message "Unable to connect to the database used by the following application(s) (Default Web Site/BatchWeb). Dropping event with event ID 108. This event has occurred 63 times." from the Administrative Events log.
From the IIS Manager, I can see the ConnectionString for the "ApplicationServerMonitoringConnectionString" is "Data Source=SALExxxx2\SQL2008;Initial Catalog=AppFabricMonitoringDB;Integrated Security=True" and the Entry Path is "MACHINE/WEBROOT"
I have replicated all the code in a new project on my computer, one this is that when I try to add my service reference locally I do not get any method for the proxy called BatchWorkerClient there fore I cannot invoke SubmitJob. In my config file I noticed that when I add the service reference it doesn't look completely like the example. It is putting in a http address for the service reference instead of the net.pipe address. Any help would be appreciated. Thanks!
When you add a service reference http:// is used by default. You can switch it to net.pipe:// if you want but you have to be sure net.pipe is enabled in your IIS application (this is required for AppFabric anyway).
So in your solution did you add the net.pipe:// protocol in your web config manually. I do have net.pipe enabled in IIS for this website and I still didn't get BatchWorkerClient method auto generated in the reference.cs file.
Ok I when I add the service reference I put in http://batchweb/BatchWorker/BatchWorker.xamlx and name my service reference "Services". It automatically added the endpoint and the bindings for net.pipe. However, I still don't get the method BatchWorkerClient in auto generated in the Reference.cs to call from the BatchAutoStartFactory. The only methods it generated was SubmitJob, StopJob and QueryJob. Thanks for your help.
Yes I understand that. But when I add the service reference it is not automatically produced in my Reference.cs file. I have your sample running locally, but I cannot get it to auto start. IIS is set up as enable auto start.
I install the Windows Server AppFabric and run the Configure AppFabric too. But the fields it create on the ASWfEventsTable is less then the one you have. Also you can see that the table name is deferent too. Am I running the correct Version? Thanks!
Hi, thanks for the post. I don't have much experience with ASP.Net but I want to get this example running to play around with.
What are the manual changes I need to make in order to run this? I changed database connection string in web.config file but it complains about dbo.ASWfInstances not found.