You are on page 1of 31

Building Solutions using the

2007 Office System


Workflow Infrastructure
Rames Gantanant
ramesg@ineta.org
Microsoft, Regional Director
Microsoft, MVP
Puumsoft, Director of Business Solutions
Vision for Windows Workflow
• Single workflow technology for Windows
– Base for Microsoft products and ISV/customer solutions
– One technology for human and system workflow
• A framework not a server product or application
– An extensible framework based on Microsoft .NET
– Ships as Part of .NET 3.0 (WinFX), which ships in Windows
• Make workflow mainstream for .NET developers
– Strong workflow partner & solution ecosystem
– Reach mainstream application developer
PRESENTATION DATA COMMUNICATION

Presentation Framework ASP.NET ADO.NET Language Integrated Query Windows Communications Foundation Windows Workflow Foundation
System.Windows (3.0) System.Web (2.0) System.Data System.Query (F) System.ServiceModel (3.0) System.Workflow (3.0)
Annotations Compilation Common System.Data.DLinq (F) Channels System.Workflow.Activities (3.0)
Automation Configuration Odbc System.Xml.XLinq (F) Configuration Rules
Controls Handlers OleDb System.Expressions (F) Diagnostics System.Workflow.ComponentModel (3.0)
Data Hosting OracleClient Integration Compiler
Documents Mail Windows File System QueueHelper Designer
Sql System.Storage (F)
Ink Management SqlClient System.ServiceModel.Security(3.0) Serialization
Interop Core Protocols System.Workflow.Runtime (3.0)
Security
Navigation Audio Tokens Hosting
UI (2.0) ASP.NET Data Management
Resources System.Web Calendar Messaging
Util
Serialization Caching Contacts Network Class Library
Shapes Profile Documents System.Net ASMX Web Services
Printing Subsystem Image
Threading SessionState Cache System.Web.Services
System.Printing (3.0) Media
System.Windows.Media (3.0) Mail (2.0)
Messages Identity Management
3D GDI+ XML Data
Network Information (2.0)
System.Drawing Rules Security (2.0) Microsoft.InfoCards (3.0)
Animation System.Xml
Imagine Design Sync Sockets
Schema MSMQ
Drawing2D Video
Serialization System.Messaging
Windows Forms Printing .NET Remoting
System.Windows.Forms (2.0) XPath XPS Documents
Xsl System.Runtime.Remoting Directory Services
Design System.Windows.Xps (3.0)
System.IO.Packaging (3.0) System.DirectoryServices
Layout .NET Remoting
VisualStyles System.Runtime.Remoting
Speech Integration
System.Speech (3.0)
Recognition
Synthesis

FUNDAMENTALS

BASE CLASS
LIBRARIES
System System.Text System.Text System.Text Managed Add-In System.Runtime
Generic (2.0) AccessControl Framework CompilerServices
System.CodeDom System.ServiceProcess (2.0) System.Addins (F) ConstrainedExecution(2.0)
System.Reflection Cryptography (2.0)
System.ComponentModel System.Threading Contact InteropServices
Email Permissions Hosting
System.Diagonostics System.Timers Policy Microsoft.Build (2.0)
System.Configuration Serialization
System.IO (2.0) System.EnterpriseServices Principal (2.0) Versioning
System.Resrouces System.Transactions (2.0)
“ClickOnce” Deployment
System.Deployoment (2.0)
KEY

(2.0) (3.0) - New


(2.0) - Substantially Improved
WINDOWS VISTA
- Windows Presentation Foundation
(formerly codenamed “Avalon”)
- Windows Communication Foundation
(formerly codenamed “Indigo”)
- Windows Workflow Foundation
Workflow Ecosystem

Access
SharePoint
Authoring
Browser Designer
Outlook
SharePoint Apps
UI
Services
Source Task
List List

History Reporting
List & Admin
Initiation and
parameter setting Wizard-based
WF Web authoring
Task Completion
Service
Task and
Initiation Forms integration
Reporting
Administration
Notification
parameter setting Application
Reporting/Status
Task
Ad-hoc deployment
Initiation
Completion
Customization
(Forward/Delegate)
Parameter setting
Task Completion
Ad-hoc Customization
(Forward/Delegate)
Task Notification
and Completion
Workflow Scenarios

Structured
LOB
Applications

Microsoft Visual Studio


Purchase Order Product lifecycle
and workflow SDK Processing management

Office SharePoint Custom Form Actions Document Processes


Email Notification Spec Review
Designer workflows Exception Handling Weekly Status Report

Out-of-the-Box

Ad Hoc
Office Server Features Routing & Approval
Solutions List Moderation Review
Publishing Process Approval
(with customization) Document Expiration Signature collection
Windows Workflow Foundation
Visual Designer
Key Concepts
Workflows are a set of activities
Activities are the building blocks A Workflow
Workflows run within a Host Process:
Any application or server An Activity
Developers can build their own
Custom Activity Libraries Custom Activity Library
Components Windows
Base Activity Library: Out-of-box Workflow Foundation
activities and base for custom activities
Runtime Engine: Workflow execution Base Activity Library
and state management
Runtime Engine
Runtime Services: Hosting flexibility
and communication Runtime Services
Visual Designer: Graphical
and code-based construction Host Process
Type of workflow
กระบวนการทางาน (Activities) ทีต
่ อ
่ เนือ
่ ง

Example activities…. ส่ งต่ อให้ หัวหน้ าอนุมัติ สิ นค้ าถูกสั่ งโดยอัตโนมัติ

จัดกลุม
่ ได ้เป็ น 2 รุปแบบของ workflow ด ้วยกัน…

Like a flowchart…. Or a state diagram….


Workflow Software Challenges
Real World Behavior Software Challenges

“Orders are confirmed in Long Running and Stateful


48 hours and shipped Workflows run for up to 30
within 30 days” days and must maintain
state throughout
“Most suppliers
Flexible Control Flow
confirm our orders but
Flexibility for people to
some forget and we
override or skip steps in
need to followup”
the workflow

“What is the status of Transparency


this order and what is Rendering runtime state
the next step?” within a visualization of the
workflow control flow
Workflow Authoring Tools
SharePoint Designer (Web Visual Studio (Pro-Dev)
Designer)
Development Model
Development Model Visual workflow designer
Wizard-based workflow designer
Activities
Activities Re-use OOB/deployed activities
Re-use OOB/deployed activities Can author new activities

Forms Forms
Auto-generated Forms Designed Forms
-ASPX -InfoPath
-ASPX
Deployment
Workflow authored live against Deployment
server Solutions package generated
Runtime compilation Box administrator installable
Workflow Authoring Modes
Markup Only Markup and Code Only Application
“Declarative” Code Generated
App creates activity
XAML XAML C#/VB C#/VB tree and serializes

• XML defines • XML defines • Code creates


workflow structure workflow workflow
• Code-beside in constructor
logic and data flow XAML C#/VB
defines extra logic

Workflow Compiler
wfc.exe
.NET assembly
C#/VB Compiler • ctor defines
workflow
Business Processes And
Workflow Models
Business Process Workflow Model
Control Flow Processes Sequential Workflow
Well understood sequence of
A1
events
Sequential in nature A2 A3

Process is the driver A4

Suitable for process automation


Event Driven Processes State Machine
Driven by external events Workflow
Unpredictable sequence of events S1
S2
Many alternative business paths
May jump to any step S3

S4
Workflow
Designer
Building a simple workflow
Windows SharePoint Services
Document Document
Library 1 Library N
SQL Server
...
Site 1 Site 2 … Site N

List 1 List N
Item A Item A Windows Server 2003
...
Item B Item B
Windows SharePoint Services
Item C Item C
... ...
Internet Information Services

Microsoft Office Web Browser


Applications
Workflow and Windows SharePoint Services 3.0
SQL Server

Document Site 1 Site 2 … Site N


Library

Windows Server 2003


Workflow Instances

Associations

List WF Runtime Engine


Workflow
Item A Templates Windows SharePoint Services
Item B
Item C Internet Information Services
...

Microsoft Office Web Browser


Applications
Development Steps
• 2 Choices:
– Model workflow in Microsoft Visual Studio
– Model workflow in Office SharePoint Designer 2007
• Create and bind Microsoft Office InfoPath 2007
or ASPX forms
• Deploy to Windows SharePoint Services
• Debug the running workflow
Create and Bind InfoPath Forms
Types in Workflows
• Association form • Task completion form
– User adds workflow to a list – A user to edit a task from
– For setting options on WF WF
• Initiation form – User edits or enters data
– For manual workflow start • Modification form
– Collects workflow – Linked off WF status page
parameters – Can modify in-flight WF
Building a Custom Workflow
with Visual Studio
Sharepoint Project Template
• If Sharepoint project template does not show in
VS2005..
• Open a Microsoft® Visual Studio® 2005 (VS)
Command Prompt.
• Run “devenv.exe /setup”. The templates should be
installed to %Program Files%\Microsoft Visual Studio
8\Common7\IDE\ProjectTemplates\CSharp or
VisualBasic under the SharePoint folder
Activities in VS2005 Toolbox
• If Sharepoint activities do not show in your toolbox…
• To load activities into the VS Toolbox:
– In workflow design mode, right click in the Toolbox. Select
“Choose Items”.
– In the activities tab, browse for the dll at
%programfiles%/Common Files/Microsoft Shared/web server
extensions/12/ISAPI/Microsoft.SharePoint.WorkflowActions.dll.
– (optional) By default, all activities here are selected. You can
deselect activities that you do not wish to see.
Deploy to SharePoint Server
• Generate key pairs
• Compile workflow as a strong-named assembly
• Generate Metadata files
– Feature.XML
– Workflow.XML
• Install/activate the “feature”
• IISReset
• Associate workflow to the list/library
Code Snippet Manager
• If the code snippets are not showing up in Visual
Studio, go to Tools->Code Snippets Manager or
CTRL+K CTRL+B, change the language to XML,
and add %Program Files%\Microsoft Visual
Studio 8\Xml\1033\Snippets\Windows
SharePoint Services Workflow to your
snippets.
Debug the Running Workflow
• Visual Studio running on server machine
• Open the workflow in Visual Studio
• Attach to all of the W3WP Processes
• Start the workflow
• WSS log file: C:\Program Files\Common
Files\Microsoft Shared\web server
extensions\12\LOGS
Deploying and Testing a
Custom Workflow
Developing Advanced
Workflow
Collect Feedback Workflow

Start the workflow Collect Feedback

Feedback Received
Making a Technology Choice
• VS2005 Designer for Windows • Office SharePoint Designer
Workflow Foundation
– No code behind; workflow
– Code-behind file enables rules file declaratively
developer to write custom
encapsulates business logic
Microsoft Visual C# or
Microsoft Visual Basic code to instead
express business logic – Must use activities provided
– Can author custom activities – No step-by-step debugging
for inclusion in workflows available
– Visual Studio debugging – Can author only sequential
available workflows
– Can author both sequential
and state workflows
Resources
– Download the Microsoft .NET Framework 3.0
– http://www.microsoft.com/downloads/details.aspx?familyid=10CC340B-F857-
4A14-83F5-25634C3BF043&displaylang=en
– Download the Microsoft VS 2005 Extensions for WWF
– http://www.microsoft.com/downloads/details.aspx?familyid=5D61409E-1FA3-
48CF-8023-E8F38E709BA6&displaylang=en
– Download the Microsoft® Windows® SDK Kit for Windows Vista™ and .NET
Framework 3.0 Runtime Components
– http://www.microsoft.com/downloads/details.aspx?familyid=7614FE22-8A64-
4DFB-AA0C-DB53035F40A0&displaylang=en
– Download the Windows SharePoint Services 3.0
– http://www.microsoft.com/downloads/details.aspx?familyid=D51730B5-48FC-
4CA2-B454-8DC2CAF93951&displaylang=en
– Download the Windows SharePoint Services 3.0 SDK
– http://www.microsoft.com/downloads/details.aspx?FamilyID=1c64af62-c2e9-
4ca3-a2a0-7d4319980011&DisplayLang=en
– Download samples, tools, and runtime service components
– http://wf.netfx3.com/
© 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not
be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation.
MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

You might also like