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

Related Links

OwnershipTimeoutSeconds
Problem in WorkflowRuntime.WorkflowCompleted event
HandleExternalEvent Problem
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
WF Virgin
Error in the Hands on lab 09
Workflow Designer
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

Categories

MSDN
Microsoft Office for D...
Windows Phone Dev Center
Visual Studio Design a...
Dynamics
Microsoft Research
Project Server
Other Forums
Archived Forums M
Archived Forums N-R
Archived Forums V
Archived Forums Visual...
Cortana
Visual C#
Visual Basic
Visual F#
Visual Studio LightSwi...
Test Tools in Visual S...
Windows App Studio Beta
AdSDK Integration & Ad...
Application Compatibil...
User Interface develop...
Windows Desktop Web Se...
Hardware Development B...
Excel for Developers
Word for Developers
Office 365 for Developers
SharePoint 2013 - Gene...
SharePoint 2013 - Deve...
Service Bus
Azure API Management
Azure DocumentDB
Machine Learning
Azure Log Integration
Azure Database for Pos...
Windows Presentation F...
Team Foundation Server...
The Architect Role
Microsoft Solver Found...
Debugger Canvas
HealthVault Developer
Partnering with Microsoft
Microsoft Robotics - D...
Microsoft Robotics - V...
Visual Studio Smart De...
Visual Studio Smart De...
SQL Server Tools
SQL Server SMO/DMO
SQL Server Database En...
SQL Server Compact
Database Mirroring
SQL Server Distributed...
SQL Server Data Tools
Standard 7: Misc
Windows Embedded Compa...
ClickOnce and Setup & ...
Server Virtualization
MSDN and TechNet Searc...
Script Junkie Discussion
WebsitePanel - Develop...
Microsoft Automatic Gr...
Microsoft Lync Client ...
Microsoft Lync Server ...
Programming Silverligh...
Performance Profiling ...
Silverlight for Window...
Designing with Silverl...
Expression Studio with...
Connected Services Fra...
Windows Performance To...
Project Online General...
.NET Framework 4 Appli...
Dryad, DSC, and DryadL...
Game Technologies: Gen...
HealthVault Data Types
(Retired) Exchange Pre...
LINQ Project General
Microsoft Unified Comm...
Parallel Computing Pla...
Popfly Explorer
Regular Expressions
Search Server: Feature...
Search, Organize, and ...
Sharepoint Development...
Software Transactional...
Storage Platform – ATA
Surface Application De...
SyncFx - Feedback [Rea...
SQL Server 2014 Self-S...
Team Foundation Server...
Tools for Windows Phon...
UI Design for Windows ...
Visual J# General (Ret...
Visual Studio Guidance...
Web Sandbox - Exploits
Windows Error Reportin...
Windows Presentation F...
Windows SideShow Devel...
Building Windows Store...
Building Windows Store...
Tools for Windows Stor...
XML in Visual Studio a...
XNA Framework
Ad Revenue, Payout & T...
Windows Phone Preview ...
Windows Phone Preview ...

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile