I'm using Windows Workflow as part of a class library in an ASP.NET application. I've read all the suggestions about setting up WWF in ASP.NET and using a ManualWorkflowSchedulerservice, however, I'm not sure if that makes sense for my app.
My workflows are all sequential, no persistance; they're fire and forget. A client makes a request and comes back later to see the results (or waits around on the app). Up to now I've been using AJAX web service class to fire off the job.
function DoWebserviceJob()
{
MywebService.DoJob(onComplete, onFailed);
}
[WebMethod]
public DoJob()
{
//code from library
}
If the customer was still around he'd get a notice, if not it was OK. Now I'm using WWF instead of coding straight from the library. I know this works(since I've done it) but I'm wondering if there are some side-effects that I'm not aware of or other concerns. My new code looks like this:
[WebMethod]
public DoJob()
{
WorkflowRuntime runtime = Application["RUNTIME"] as WorkflowRuntime;
MyWorkflowManager.DoJob(runtime);
}
My Class Library:
public void DoJob(WorkflowRuntime runtime)
{
WorkflowInstance instance = runtime.CreateWorkflow(typeof(MyWorkflow));
instance.Start();
}
This is a bit simplified, but the overall process is here. This works fine right now, are there are any issues I should be concerned with? If it's threads (which seems to be the most cited concern), Iis this not the same as webservice firing off on a different thread?