Windows Workflow Foundation 3
Starting a loaded instance
Hi I have a problem when I try to reload a specific instance and start running it from the point it has stopped. My workflow will do some steps and has a variable "ApprovalStatus" that will contain the customer approval status. The workflow will start by taking the customer info as parameters, and I saved the InstanceId in XML file, to reload it later, and unloaded and end runtime. The workflow supposed to resume working from another form that enters the orderID and the status after getting a phone call from the customer to confirm the order or cancel the order. ExternalDataExchangeService svc = new ExternalDataExchangeService(); workflowRuntime1.AddService(svc); svc.AddService(sales); SqlWorkflowPersistenceService sqlStatePersistence = new SqlWorkflowPersistenceService("Initial Catalog=FourWindsPersistence;Data Source=localhost\\SQLEXPRESS;Integrated Security=SSPI;", true, new TimeSpan(10, 0, 0), new TimeSpan(0, 0, 2));//, // Add the SqlStatePersistenceService to the WorkflowRuntime workflowRuntime1.AddService(sqlStatePersistence); Dictionary<String, object> parameters = new Dictionary<string, object>(); parameters.Add("EmployeeID", int.Parse(EmpTxt.Text)); parameters.Add("OrderId", int.Parse(OrderTxt.Text)); WorkflowInstance instance1 = workflowRuntime1.CreateWorkflow (typeof(Moving.MovingSale), parameters, loadedinstanceid); instance1.Load(); instance1.Start(); sales.RaiseEvent(instance1.InstanceId, int.Parse(OrderTxt.Text), Status.Text); But the problem is that the workflow starting over the executing each time. Question: How can reload specific instance and start executing from the point it was stopped? Note: I will use External data exchange service and a listen activity to get the data from the host as shown in the previous code… Thanks…
You only want to call Start() when you're creating a new workflow instance. When it is an existing workflow instance you'd call instance1.Resume() instead.Matt
Problem in WorkflowRuntime.WorkflowCompleted event
WWF with .NET compact framework 2.0
How can I query StateMachineWorkflowInstance before the WF idles
Question about modifying a workflow
Rule Conditions against custom activities and XAML activation - how should I achieve this?
MOSS Publishing Site
WF custom persistence once again
Hands on Labs 2.2
Error in the Hands on lab 09
How do you load XOML only State Workflow in WFPad for WWFBeta 2.2 (with namespace for codebehind assembly, and activities)?
invoke sub StateMachine workflow
Using WWF to model and support "Tech Trees" in RTS games