Transcript
Page 1: SharePoint Saturday Workflow in Action

Workflow in SharePoint 2010

Elaine van BergenArchitectOBS

Page 2: SharePoint Saturday Workflow in Action

The Connected EnterpriseWhere workflow fits in

• Collaboration happens in SharePoint People at work Data they make and use

• Workflows to manage it• Two flavours

System – move data inand out of SharePoint

Human – support peoplewith long-running processes

People

Content

Page 3: SharePoint Saturday Workflow in Action

Human Workflow Examples

• Managing how people work Document approval & feedback Collaborative reviews & discussions Gathering signatures

• Business logic in action Rules for SharePoint content Applied automatically or on demand “Glue” used to build common business apps

Page 4: SharePoint Saturday Workflow in Action

"Whats New" for SharePoint 2010• For the end-user

New targets to run a workflow Visio visualization

• For the power-user Improved nested logic New Task Process designer Customizable OOB workflows

• For the developer Visual Studio 2010 SharePoint tools Workflow Events Pluggable External Data Exchange Services

Page 5: SharePoint Saturday Workflow in Action

Windows Workflow Foundation• Workflow engine shipped as part of

the .NET 3.0 Framework

• Model workflows as state machines or sequential steps

• Long-running and stateful

Page 6: SharePoint Saturday Workflow in Action

WorkflowRuntime

Workflow

Windows Workflow Foundation

Workflow Services

Scheduler Persistence Tracking Batching

SharePointCRMLOB

Workflow Workflow

Page 7: SharePoint Saturday Workflow in Action

Workflow Solution Spectrum

Out-of-Box Workflows

• Ready to use• Common

approval scenarios

Out-of-Box Customization

• Association and initiation settings

• Modify logic in SharePoint Designer

• Design forms in InfoPath

Custom Declarative

• Start from scratch or from existing

• New actions• Task process

framework• More types of

workflows

Custom Activities

• Encapsulate custom code in new action

• Deploy in full or partial trust (as user code)

Custom Non-Declarative

• Import solution into Visual Studio

• Advanced modeling

• Hook up workflow to events

Incr

easi

ng F

uncti

onal

ity

Browser Visual StudioSharePoint Designer

Page 8: SharePoint Saturday Workflow in Action

Prototype, Design and DevelopSharePoint 2010 offers new development process

Envision workflows in Visio Import into SharePoint Designer

• Parameterize– Export to Visual Studio 2010

Add code

Visio SPD VS10

Page 9: SharePoint Saturday Workflow in Action

Declarative vs. Code-Based Workflows

• Developed with .NET code• Compiled to template assemblies• Packaged as features• Deployed via WSP packages• Added to feature galleries• Activated per-site collection• Versioned like code• Can do all of the work in internal code • and/or call activities

Code-Based Workflows Declarative Workflows• Developed as XOML (eXtensible

Orchestration Markup Language)• JIT compiled and run by a

template assembly provided by SharePoint

• Published to containers (lists, libraries, etc.)

• Versionable like documents (with help)

• Connect activities together, but the activities do the work

Page 10: SharePoint Saturday Workflow in Action

A Gartner 2008 survey showed that:• 67% of companies that are "doing BPM" changed

some of their business processes at least twice a year. • 18% needed to make changes on a monthly basis• 10% on a weekly basis and • 4% on a daily basis

Page 11: SharePoint Saturday Workflow in Action

Visio to DesignerLive Demonstration

Page 12: SharePoint Saturday Workflow in Action

Tool Enhancements

• SharePoint Designer 2010 Big design interface improvements Full screen, more available context data, import/export,

nested logic It’s what we’ve been using for all of the demos so far

• Visio 2010 Allow business analysts to design workflows Provide graphical workflow status (Visio Services)

Page 13: SharePoint Saturday Workflow in Action

Declarative workflows• Performance improvements*• InfoPath forms for association, activation, tasks• Reusable workflows

Content types Association columns Promotable to “globally” reusable Out-of-box workflows work this way now

• Site workflows*• Workflows on document sets*• Impersonation steps*• Export to Visual Studio*not just for declarative workflows; also for code-based workflows

Page 14: SharePoint Saturday Workflow in Action

Reusable Workflows

• Not tightly coupled to specific lists• Associated with lists or content types• Association columns• Promotable to “globally” reusable• Out-of-box workflows work this way now

Page 15: SharePoint Saturday Workflow in Action

SharePoint 2010 Workflow Targets

Site List Item

Page 16: SharePoint Saturday Workflow in Action

Site Workflows• Bound to site, not to a list or content type

• Started manually

• Accessible from Site Actions menu Go to View All Site Content to see them

• Perfect for workflows that: Work on groups of content Work mostly on non-SharePoint content

Page 17: SharePoint Saturday Workflow in Action

Custom activities• Plug in your own custom activities

Fully trusted deployment model Sandboxed code in the user solution gallery

• Build on top of existing activities OfficeTask exposed in Visual Studio

• Flexibility of custom code, reusable in code-based and declarative workflows alike

Page 18: SharePoint Saturday Workflow in Action

New and improved out-of-the-box actions• User profile lookups• Document sets• Declare record• Set permissions• Read/write to external lists• Utility actions• Task Processes

e.g., Office Task Composite activities Design dialogs

Page 19: SharePoint Saturday Workflow in Action

How It Works: The “OfficeTask”

Workflow activity Workflow activity

Approval start behavior

Approval in progress

Approval end behavior

Task start behavior Task in progress Task end behavior

For each task… Exit conditions

Page 20: SharePoint Saturday Workflow in Action

Example: Expense Reporting

Workflow activity Workflow activity

Check metadata on uploaded

report

Approval in progress

Set status to either Approved or Rejected, and notify submitter

Task start behaviorSend daily

reminders when due date passes

Task end behavior

If anyone rejects, cancel the approval

Page 21: SharePoint Saturday Workflow in Action

DesignerLive Demonstration

Page 22: SharePoint Saturday Workflow in Action

What’s new in Visual Studio 2010

• Site Workflows• ASP.NET Form Templates• New events• External Data Exchange

Page 23: SharePoint Saturday Workflow in Action

Developing Site Level Workflows

• Site Workflows List / Item properties are null No auto-start

Page 24: SharePoint Saturday Workflow in Action

Creating ASP.NET Workflow Forms

• Generates the required code

• Updates the elements.xml file

• Available: Association Initiation

Page 25: SharePoint Saturday Workflow in Action

Workflow Events

• Events fired during workflow lifetime Started, Completed…

• Scenarios Call sub-workflows and wait for completion Provide more elaborate error handling

• Familiar model for developers

Page 26: SharePoint Saturday Workflow in Action

SPWorklowEventReceiver

• Base class for handling workflow events

Register on site / list / content type

public class MyWorkflowEventReceiver : SPWorkflowEventReceiver{ public override void WorkflowStarting( SPWorkflowEventProperties properties) { // your code here base.WorkflowStarting(properties); }}

Page 27: SharePoint Saturday Workflow in Action

External Data in SharePoint 2007

SharePoint Data

External Data

Correlated Events

Page 28: SharePoint Saturday Workflow in Action

Pluggable EDE Services• Interact with LOB systems

by using custom External Data Exchange services

• Requires low-level understanding of WF layer

• You can write your own events No partial trust

Page 29: SharePoint Saturday Workflow in Action

Flow of EventsWorkflo

w

EDE Service

External System

Subscriptions

WorkflowRuntime

Call External Method

Raise Event

WCF Service

External System

Or

Page 30: SharePoint Saturday Workflow in Action

Visual StudioLive Demonstration

Page 31: SharePoint Saturday Workflow in Action

Question and Answer Time

@laneyvbhttp://laneyvb.blogspot.com

Page 32: SharePoint Saturday Workflow in Action

Feedback details

• Connect to the “GUEST” wireless network• Browse to the URL http://10.2.70.199 • At the Cliftons log on screen use these credentials

– User: CSC– Password: 9A4F

• Select “forms authentication” and then log on with the details you were emailed during the week

• If you need a logon or need help, see Brian or Lewis at the front desk

How to do tell us what you think

Page 33: SharePoint Saturday Workflow in Action

Thanks for Listening!And Thank You To Our Sponsors!