2. 27 August, 2010
WorkFlow 4
Like any technology, applying WF requires
understanding
what it is,
why it's useful,
and when it makes sense to use it.
3. 27 August, 2010
WorkFlow 4
Isn't WorkFlow Foundation just a visual way to
write code and thus despicable?
What is Windows Workflow Foundation?
A framework for declarative programming
Tools for creating program definitions
A runtime for executing program logic
4. 27 August, 2010
WorkFlow 4
DESIGNER DEMO
But first the simplest possible demo
Where we also show that it's possible to add breakpoint ?!
5. WF 4.0 Data Flow Constructs
Arguments
Variables
Expressions
Used to define the way data flows in and out of an
activity.
Used to declare named storage for data within an
activity.
Performs simple operations on arguments to return
a value.
27 August, 2010
WorkFlow 4
9. 27 August, 2010
WorkFlow 4
Composability
a workflow can contain flowcharts, state machine, C# code, ...
everything is an activity
10. Challenges
Work is increasingly distributed
Coordination code creates complexity
Coordinating messages with application state
Coordinating calls to a database or another service (Async I/O)
Coordinating rainy day scenarios
Management and tracking of distributed work is difficult
27 August, 2010
WorkFlow 4
14. 27 August, 2010
WorkFlow 4
Integration
SharePoint 2010 uses WF3?
But there is an upcoming book "Professional Workflow 4 in
SharePoint 2010: Real World Business Workflow Solutions "
http://www.amazon.com/Professional-Workflow-SharePoint-
2010-Solutions/dp/0470617888
TFS2010 uses WF4
15. 27 August, 2010
WorkFlow 4
Documentation
The business analysis can be mapped directly translated to
workflow/code
There is no distinction between documentation and code
IAB Flowchart on the next slide =>
20. 27 August, 2010
WorkFlow 4
Workflow Service User Model
Operator Commands:
• Suspend, Resume, Terminate and Cancel
Running
Active - In Memory
Idle – Persisted
Suspended
Reason:
• Exception code
• Exception text
Completed
Suspend
Resume
• Successful
Completion
• Terminate
• Cancel
•Terminate
• Cancel
21. 27 August, 2010
WorkFlow 4
Persistence / Durability
Windows
Server
AppFabric
Windows
Server
AppFabric
Load
Balancer
Persistence
DB
Workflow
Service
Workflow
Service
Workflow
Management
Service
Workflow
Management
Service Windows
Server
AppFabric
Workflow
Service
Workflow
Management
Service
Instance
123 | data
456 | data
789 | data
011 | data
22. 27 August, 2010
WorkFlow 4
Persistence
Persistence lets you pause an instance, save it
somewhere & resume it later
A persisted instance has no affinity to a WF host instance,
CLR instance, thread, process, or machine
Helps with scalability; helps with recovery from failure
WF program instances are serializable
A CLR stack is not serializable, but in a WF program a stack
only exists transiently, during work item execution
Details of persistence are deliberately separate from
the machinery of the WF runtime
23. 27 August, 2010
WorkFlow 4
What’s in a Serialized Instance?
A serialized instance contains:
Work item list (empty if instance is idle)
Bookmarks
Data (arg and var values)
•Environments for all executing activity instances
Activity instance info (callbacks, execution props)
Custom data from persistence participants
Does not contain the workflow definition
A million instances can share the same definition
Management of definitions is a host responsibility
24. Workflow Service = WCF + WF
Think "WCF on the outside, WF on the inside“
WCF exposes external interface
WF describes internal flow & state transitions
27 August, 2010
WorkFlow 4
25. 27 August, 2010
WorkFlow 4
Workflow services
WCF Workflow Services
WCF Service
WF Workflow
Client
External
Service
External
Service
WCF endpoint
WCF endpoint
28. 27 August, 2010
WorkFlow 4
Server AppFabric
Most WCF services are hosted in IIS / WAS
IIS tooling designed for managing web applications
Windows Server AppFabric = service management
Simplified configuration of services and workflows
Operations dashboard
Workflow service management
GUI and PowerShell tools
30. 27 August, 2010
WorkFlow 4
Server AppFabric
Health overview provides information about services
Exceptions / completed call count / throttling limits reached
Workflow instances (active / suspended)
Recent history – activations / failures
Access to workflow information
List of persisted workflows
Tracked workflow data and events
Tools are based on tool scope (site / application / service)
Custom queries also possible
32. 27 August, 2010
WorkFlow 4
PowerShell support
PowerShell is THE modern scripting environment on Windows
Most commands and data available as PowerShell cmdlets
Get and set configuration settings
Enable application messaging
Instance management – resume, suspend, terminate
Combine with other web modules
Web Administration PowerShell module for managing IIS
MSDeploy – synch or deploy local or remote services
Transactions are necessary when two or more activities must be coordinated as a single operation, ensuring that the system is always left in a consistent state. The only two viable options are to complete all activities successfully or to leave the system as it was before initiating either activity.
Transactions are necessary when two or more activities must be coordinated as a single operation, ensuring that the system is always left in a consistent state. The only two viable options are to complete all activities successfully or to leave the system as it was before initiating either activity.
Transactions are necessary when two or more activities must be coordinated as a single operation, ensuring that the system is always left in a consistent state. The only two viable options are to complete all activities successfully or to leave the system as it was before initiating either activity.
Transactions are necessary when two or more activities must be coordinated as a single operation, ensuring that the system is always left in a consistent state. The only two viable options are to complete all activities successfully or to leave the system as it was before initiating either activity.
Transactions are necessary when two or more activities must be coordinated as a single operation, ensuring that the system is always left in a consistent state. The only two viable options are to complete all activities successfully or to leave the system as it was before initiating either activity.
Transactions are necessary when two or more activities must be coordinated as a single operation, ensuring that the system is always left in a consistent state. The only two viable options are to complete all activities successfully or to leave the system as it was before initiating either activity.
Transactions are necessary when two or more activities must be coordinated as a single operation, ensuring that the system is always left in a consistent state. The only two viable options are to complete all activities successfully or to leave the system as it was before initiating either activity.
Transactions are necessary when two or more activities must be coordinated as a single operation, ensuring that the system is always left in a consistent state. The only two viable options are to complete all activities successfully or to leave the system as it was before initiating either activity.
Transactions are necessary when two or more activities must be coordinated as a single operation, ensuring that the system is always left in a consistent state. The only two viable options are to complete all activities successfully or to leave the system as it was before initiating either activity.
Transactions are necessary when two or more activities must be coordinated as a single operation, ensuring that the system is always left in a consistent state. The only two viable options are to complete all activities successfully or to leave the system as it was before initiating either activity.
Transactions are necessary when two or more activities must be coordinated as a single operation, ensuring that the system is always left in a consistent state. The only two viable options are to complete all activities successfully or to leave the system as it was before initiating either activity.
Transactions are necessary when two or more activities must be coordinated as a single operation, ensuring that the system is always left in a consistent state. The only two viable options are to complete all activities successfully or to leave the system as it was before initiating either activity.
Transactions are necessary when two or more activities must be coordinated as a single operation, ensuring that the system is always left in a consistent state. The only two viable options are to complete all activities successfully or to leave the system as it was before initiating either activity.
Transactions are necessary when two or more activities must be coordinated as a single operation, ensuring that the system is always left in a consistent state. The only two viable options are to complete all activities successfully or to leave the system as it was before initiating either activity.
Transactions are necessary when two or more activities must be coordinated as a single operation, ensuring that the system is always left in a consistent state. The only two viable options are to complete all activities successfully or to leave the system as it was before initiating either activity.
Transactions are necessary when two or more activities must be coordinated as a single operation, ensuring that the system is always left in a consistent state. The only two viable options are to complete all activities successfully or to leave the system as it was before initiating either activity.
Transactions are necessary when two or more activities must be coordinated as a single operation, ensuring that the system is always left in a consistent state. The only two viable options are to complete all activities successfully or to leave the system as it was before initiating either activity.