Title: Understanding Workflows in Windows SharePoint Services WSS and Microsoft Office SharePoint Server 20
1Understanding Workflows in Windows SharePoint
Services (WSS) and Microsoft Office SharePoint
Server 2007(MOSS2007)
- Serge LucaTrainer, Consultant
- Guidance
- sergeluca_at_hotmail.com
- Blog www.redwood.be
2Agenda
- Motivation for Workflow
- Windows Workflow Foundation (WF)
- WSS Integration with WF
- Office servers Integration with WF
- Creating Workflows with the SharePoint Designer
- Creating Workflows and Activities with Visual
Studio - Deploying Workflows
Ted Pattison
3Motivation for Workflow
- Automating business processes involves workflow
- Order processing
- Insurance claims processing
- Workflow very important in content management
- Feedback and moderation
- Document approval
- Lifecycle management for documents and records
Ted Pattison
4Windows Workflow Foundation (WF)
- Single workflow technology for Windows
- Extensible framework toolset
- Base platform for Microsoft, ISV and customer
solutions - A framework for building workflow into
applications - A framework to build on - not an application or
server - Exposed to developers via .NET 3.0
Ted Pattison
5What are workflows?
- Encapsulated logic for coordinating business
processes - provides abstractions to model real world
processes - valuable for modeling long running and stateful
behavior - Workflows in WinWF are decomposed into activities
State machine workflow
Sequential workflows
modeled as flowchart
modeled as state diagram
Ted Pattison
6(No Transcript)
7Serge Luca
8What are Activities
- Activities are reusable components (like form
controls) - Model based on activity producers and consumers
- Producer encapsulates logic into reusable black
box - Producer exposes behavior through properties and
events - Consumer drops activity on workflow designer in
Visual Studio
Ted Pattison
9Activity State Model
Serge Luca
Transition Initiator
Workflow Runtime
Activity
10WF Runtime Engine And Services
Host Process
My custom workflow
Windows Workflow Foundation
Runtime Engine provides intrinsic behaviors to
activities
TrackingInfrastructure
State Management
WorkflowExecution
Dynamic Update
Runtime Services pluggable implementations with
defaults
Persistence
Communication
Tracking
Ted Pattison
11WF Runtime Engine And Services
Serge Luca
Host Application
Host Application
App Domain
Runtime
Services
TrackingService
TrackingService manages profiles and stores
tracked information.
12Developing Workflows using Classes
- A workflow can be defined as a class
- Visual Studio workflow designing adds code behind
the scenes
Imports System.Workflow.Activities Partial Public
Class MyWorkflow Inherits SequentialWorkflow
Public Sub New() MyBase.New()
InitializeComponent() End Sub End
Class Partial Public Class MyWorkflow REM
designer generated Private Sub
InitializeComponent() Me.delay1 New
System.Workflow.Activities.Delay Me.delay1.ID
"delay1" Me.delay1.TimeoutDuration
System.TimeSpan.Parse("000005") Me.Activities.A
dd(Me.delay1) Me.ID "MyWorkflow" End Sub
Private WithEvents delay1 As System.Workflow.Act
ivities.Delay End Class
Ted Pattison
13Developing Workflows using XAML
- A workflow can be defined inside a XML file
- XML file written in XML Application Markup
Language (XAML) - XAML file defines a composite of parameterized
activities
lt?Mapping XmlNamespace"Activities"
ClrNamespace"System.Workflow.Activities"
Assembly"System.Workflow.Activities"
?gt ltSequentialWorkflow xClass"MyWorkflow"
xmlns"Activities"
xmlnsx"Definition"gt lt! Elements with
parameterized activities go here
--gt lt/SequentialWorkflowgt
Ted Pattison
14Developing Activities using classes
- Imports System.Workflow.ComponentModel
- Class MyCustomActivity
- inherits Activity
- Overrides Function Execute(ByVal executionContext
As _ ActivityExecutionContext) - your custom code goes here
- End Function
- Enc class
Serge Luca
15Developer Ecosystem
Workflow Developers
Minimal coding, full authoring environment
Application
Workflows
Flow Logic
Host Application
Host Developers
Application services host
Custom Activities
Runtime
Services
Out-of-box and/or Custom Services
Activity Developers
Custom execution validation logic
Serge Luca
16Devoloping Workflow with Visual Studio
Demo
17Office 2007 Workflow Vision
- To facilitate automating business processes
- by attaching business logic to items and
documents - by providing workflow context and tracking
progress - by seamlessly integrating workflow into the
SharePoint UI - To provide users with self-service capabilities
- by using solutions that ship with Office servers
- by supporting broad range of routing tracking
scenarios - by lessening/eliminating required involvement of
IT staff - To provide developers with an extensibility point
- to build WF solutions on top of WSS V3 and Office
servers
Ted Pattison
18WSS Workflow Fundamentals
- WSS supports workflows on items and documents
- WF associated with list, document library or
content type - WF can be started and completed by user actions
- WF can be configured to start without user action
- WSS adds a dimension of human accountability
- All WSS workflows are associated with a task list
- WSS adds a dimension of tracking and reporting
- All WSS workflows are associated with a workflow
history list
Ted Pattison
19Background WSS Task Lists
- WSS provides a native Task list type
- WSS task lists integrated with Office 2007
applications
Ted Pattison
20Workflow-Aware Applications
- Browser
- Farm and site collection administration
- Workflow initiation, configuration and completion
- Office 2007 Applications (e.g. Word, Excel,
PowerPoint) - Workflow initiation, configuration and completion
- Outlook 2007
- Task notification and task completion
- SharePoint Designer
- Wizard-based authoring and forms integration
- Application deployment
- Access
- Reporting
Ted Pattison
21WSS Workflow Architecture
Ted Pattison
- Workflows are run on items and documents
- Workflows associated with list, document lib or
content type - Farm-wide table tracks associations to WF
templates
Workflow Template Collection
Workflow Assembly
Workflow A
Content Type
Farm-level Workflow Association Table
Workflow Assembly
Workflow B
List
Workflow Assembly
Document Library
Workflow C
22Workflow Hosting with WSS 3.0
Ted Pattison
WSS Application Pool Worker Process
My custom WSS workflow
WSS created component
Windows Workflow Foundation
Runtime Engine provides intrinsic behaviors to
activities
Rules
Scheduler
Tracking
Runtime Services custom WSS implementations
WSS Content Database
Persistence
Transactions
Notifications
Tracking
Messaging
Roles
23Workflow Stages
- Workflow Association
- Workflow installed by farm administrator at
server level - Workflow bound and configured by site collection
administrator - Workflow Initiation
- Launched by user either manually or automatically
- Workflow Status
- Users can view status of workflows on any item or
document - Workflow Task Completion
- Manually triggers by user or automated through
code
Ted Pattison
24Associating a Workflow
Ted Pattison
25Using a built-in MOSS Workflow
DEMO
Ted Pattison
26Workflow Forms
- Forms are used for
- Configuring workflows
- Starting workflows
- Completing tasks
- ASPX Forms
- Can be used by WSS and Office servers
- Server-side only
- InfoPath Forms (Office servers)
- Server rendered by Office forms Server
- Office client integration
- Write once, run server and client (same form)
Ted Pattison
27Creating a Workflow with the SharePoint Designer
Demo
Ted Pattison
28Developing Sharepoint Workflows with Visual Studio
- Scenarios New Activities, LOB Workflows
- Rules based workflows E.g. Expense Reports
- State machine workflows E.g. Retention Policy
- Creating activities for reuse
- Authoring environment includes
- Graphical workflow designer
- Code behind workflows
- Activity reuse
- Debugging
Ted Pattison
29Creating a New Workflow Project
Serge Luca
- Must install WSS Workflow project templates
- RTM version of download available RSN
30The Workflow Designer and WSS WFs
Activities from WF Base Library
Activities from WSS Activity Library
Ted Pattison
31Office Activity Examples
Activities are the building blocks workflows.
- Document
- Send To Official File
- Get Range (XLServer)
- Translate Document
- Web
- Send email
- Create alert
- Validate User Rights
- Request Permissions
- Workflow
- Workflow History Entry
- Audit Entry
- Task Management
- Create Task
- Complete Task
- On Task Change
- Delete Task
- Canned Tasks
- Review Task
- Approval Task
- Client side scrub task
- Item
- Update Item
- Copy/Delete Item
- On Item Change
Ted Pattison
32Workflow Deployment
- Packaging WSS workflows into solutions
consisting of - Workflow assembly
- Forms
- Resources
- Metadata
- Deploying workflow solution to server
- Box admin installs WSP file
- Site collection admin turns on workflow
- List administrator configures workflow
Ted Pattison
33Developing Workflows with Visual Studio Workflow
Designer
DEMO
34Summary
- Motivation for Workflow
- Windows Workflow Foundation (WF)
- WSS Integration with WF
- Office servers Integration with WF
- Creating Workflows with the SharePoint Designer
- Creating Workflows and Activities with Visual
Studio - Deploying Workflows
Ted Pattison
35Resources
- Serge Lucas blog www.redwood.be
- Eilene Hao (Program Manager Sharepoint Workflow)
webCasts website. - WF website www.windowsworkflow.net
- MS HOL (C version) www.windowsworkflow.net
- MS HOL(VB.net version) www.redwood.be or to be
published by MS in a few days.